Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if key is held down, wxpython?

Tags:

wxpython

Hello i am wondering if there is a way to check if a certain key is being held down.

Here is an example of the situation

self.button2.Bind(wx.EVT_LEFT_DOWN, self.clickedbutton)
def clickedbutton(self, e):
    if (Control is held down while the button has been clicked):
        print "it works"

Thanks

like image 568
thelost Avatar asked Dec 13 '22 06:12

thelost


1 Answers

self.button2.Bind(wx.EVT_LEFT_DOWN, self.clickedbutton)
def clickedbutton(self, e):
    if wx.GetKeyState(wx.WXK_CONTROL):
        print "it works"
like image 191
GP89 Avatar answered Dec 14 '22 23:12

GP89