Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - keyboard state during MouseWheel event

 
 
Old 05-02-2006   #1 (permalink)
Sam Jost


 
 

keyboard state during MouseWheel event

I want my app to scale using strg+mousewheel, just like Outlook or IE.

It is quite simple to hook into the PreviewMouseWheel to get the event,
but how do I check if ctrl is pressed down during the wheel event?

Sam


My System SpecsSystem Spec
Old 05-02-2006   #2 (permalink)
Drew Marsh


 
 

Re: keyboard state during MouseWheel event

Sam Jost wrote:

> I want my app to scale using strg+mousewheel, just like Outlook or IE.
>
> It is quite simple to hook into the PreviewMouseWheel to get the
> event, but how do I check if ctrl is pressed down during the wheel
> event?


You can check the static Keyboard::Modifiers property[1]. Although you might
be able to find a more friendly way do this in WPF friendly using a MouseGesture[2].

HTH,
Drew

[1] http://windowssdk.msdn.microsoft.com..._Modifiers.asp
[2] http://windowssdk.msdn.microsoft.com...useGesture.asp

___________________________________
Drew Marsh
Chief Software Architect
Mimeo.com, Inc. - http://www.mimeo.com
Microsoft C# / WPF MVP
Weblog - http://blog.hackedbrain.com/


My System SpecsSystem Spec
Old 05-03-2006   #3 (permalink)
Sam Jost


 
 

Re: keyboard state during MouseWheel event

Thanks,
((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control))
does work like I want it to.

Mouse gesture sounds intriguing, but I found no way to check for
turning the mouse wheel in there, only for mouse click.
Since I want to scale using the same way as outlook or IE I don't want
to use ctrl+mouse movement, or something.

Thanks a lot,
Sam


Drew Marsh schrieb:

> Sam Jost wrote:
>
> > I want my app to scale using strg+mousewheel, just like Outlook or IE.
> >
> > It is quite simple to hook into the PreviewMouseWheel to get the
> > event, but how do I check if ctrl is pressed down during the wheel
> > event?

>
> You can check the static Keyboard::Modifiers property[1]. Although you might
> be able to find a more friendly way do this in WPF friendly using a MouseGesture[2].
>
> HTH,
> Drew
>
> [1] http://windowssdk.msdn.microsoft.com..._Modifiers.asp
> [2] http://windowssdk.msdn.microsoft.com...useGesture.asp
>
> ___________________________________
> Drew Marsh
> Chief Software Architect
> Mimeo.com, Inc. - http://www.mimeo.com
> Microsoft C# / WPF MVP
> Weblog - http://blog.hackedbrain.com/


My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
event ID 3002 on tcp.sys integrity and event ID 10 on WMI sesclu Vista General
HELP need to solve this problem asap - Unable to start event viewer/event log service Software
Boot up Issues - Critical Event Log errors - Event ID = 100, 200, 400, 307, 402 General Discussion
mousewheel.ocx Software
Windows Event Log fails to translate event description. Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46