views:

481

answers:

1

I'm programming an application consisting of three usercontrols in an main window. In one of the usercontrols, there's a slider that needs to be controllable by keyboard input. The left arrow should decrease value, right button increase and so on. I have this work, but only when the slider has focus. If some other control has focus, I cant make it work at all.

Is it possible to define "global" hotkeys? IE keys that trigger the same event or function, no matter where the focus is? Hope I've made myself clear enough...

A: 

I have never tried this but If you have a command registered at the main window level with keys associated to it that might work. Keep in mind I have never done this but it is some thing you can try. If you are new to commands here is a blog post about it.

I have never rolled this my self but when using the built in past command I actually had to put code in to prevent it from happening in some cases.

I know this probably isn't much help but I hope it is enough to get you started.

Erin
This is definitely something to get me started, thanks!I had never heard of Commands before now, but after reading a bit about them, they seem to be quite the powerful tool, if used correctly.
Mikkel Jakobsen