Hi everyone,

I've been googling this for a long time, and most of the hits are about keyboard shortcuts in the actual IDE... it's so annoying.. :(

I'm working on a pretty big VS project (about 20 source files).. I have to add some keyboard functionality to it... simple stuff like Ctrl+N for "new" and Left for "last [whatever]" and Right for "next [whatever]"..

I've looked into GetAsynchKeyState(), but I think that applies to any keystrokes (even outside the program), and moreover I don't know what number key maps to what...
I'm amazed there's no easy way of doing this.. I spent a while looking through the toolbox and found nothing.. :(

Thank you so much!

Recommended Answers

is this what you are looking for ?

Jump to Post

All 4 Replies

is this what you are looking for ?

Do you have a GUI and a Menu? If so, then you should search on the subject of keyboard accelerators
This may also help.

since you are using VC++ i am assuming you arein the .NET framework?

do you happen to be working with windows forms?

System::Windows::Forms

if so then you can capture keyboard input very easy on any form.

Thank you all for your replies,

I got it working eventually using PreTranslateMessage.

The problem was basically that I had a richedit box in my dialog and as soon as the dialog opened, the richedit box took focus and prevented me from being able the standard ways of assigning shortcuts..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.