Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5844

ETO detect Ctrl KeyDown on button.Click event

$
0
0

@clement wrote:

Hi @dale, @curtisw,

I am trying to detect when a user clicked on a button while the CTRL key was pressed. In WinForms this can be done like this in the button.Click event:

def MyOnButtonClickEvent(self, sender, e):
    if sender.ModifierKeys == Keys.Control:
        print "CTRL was down"

however in the Eto framefork i cannot find a ModifierKeys property. So i’ve set up some KeyDown and KeyUp events for the button but it seems the events are only fired for non modifier keys or if a non modifier key is pressed together with a modifier key.

How can i detect only a modifier key (CTRL) down in the button.Click event or in a button.KeyDown event ?

_
c.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 5844

Latest Images

Trending Articles



Latest Images