Using Keymodifiers on MouseClick events

Feb 29, 2012 at 10:35 AM

Hello

I've been trying to capture different mouse clicks on elements. The behavior is different if you hold the "Ctrl" key and click and the item than when you just click.

I've noticed the KeyPressToCommand has a modifier attribute, but it seems the eventToCommand doesn't have that attribute. Have I overlooked that or is there another way to detect a "Ctrl"-click event?

 

First idea I have is to put an keypresstocommand on the main grid and set a boolean in the viewmodel.
Not sure if that will fulfill all I need to do, but it's the only thing I could think of at the moment. 

Coordinator
Feb 29, 2012 at 10:47 AM

My first thought was: yes, let's introduce the Modifiers property to the EventToCommand as well. However, a modifier seems only useful in click scenarios? Maybe introducing a ClickToCommand (but then you can't double click), etc. So, probably I will simply introduce the Modifiers property to the EventToCommand (gives great possibilities, such as CTRL + hover something).

Anyway, for now you can simply derive a new class from the EventToCommand and call it EventToCommandEx in your app framework with the modifier. As soon as we fixed it, you can mark your own EventToCommandEx as obsolete. That's way better than the workarounds via the view models.

Coordinator
Feb 29, 2012 at 10:48 AM

See this issue:

http://catel.codeplex.com/workitem/7081