For a project I will be working on, I am trying to emulate a Braille keyboard. To do this, I need to see if more than one key is pressed at a time then put the keys that were pressed into a list. For experimentation, I have the below code. It seems to only put one key into the list.
def onCharEvent(self, event):
keycode = event.GetKeyCode()
keylist=[]
keylist.append(keycode)
print keycode
event.Skip()
print "You pressed the following keys:"
for i in keylist:
print i
I figured I was making an empty list, but I couldn't use the append method unless I made an empty list first.
> On Mar 28, 2017, at 10:42 PM, Scott Talbert <s...@techie.net> wrote:
> You are creating an empty list and then appending one item to it. :)
For a project I will be working on, I am trying to emulate a Braille keyboard. To do this, I need to see if more than one key is pressed at a time then put the keys that were pressed into a list. For experimentation, I have the below code. It seems to only put one key into the list.def onCharEvent(self, event):
-- Tim Roberts, ti...@probo.com Providenza & Boekelheide, Inc.