Oops. 1. is a good point.
Point 2 deals with whether or not the program is looking for Ctrl + A (as a key
combination) or is looking for the shortcut key for "Select All", for example. How would
it be possible to look for an 'A' key on, say Korean, Hebrew, Japanese, or Arabic
keyboards, that as far as I can tell have no letter 'A' on them. So looking for the Ctrl
key plus the VK_A code is itself a culturally-biased test...if the purpose was to simulate
an accelerator, it would be more culturally-neutral to actually use an accelerator key, so
it can be localized to the appropriate key combination used. So perhaps the correct
question is whether or not it would actually be more appropriate to use an accelerator
table, thus eliminating issue 1, because in that case it would mean that an accelerator
*should* be used.
(Perhaps someone who is familiar with these keyboards can suggest how select-all, copy,
cut, and paste commands are described; are the numeric codes the same as for
roman-alphabet keyboards?).
So perhaps the question was, like many questions, far too narrow; instead of asking how to
solve a problem, it asked about how to implement a solution, which is not necessarily the
solution to the problem, but is just an implementation of something which may or may not
be related to solving whatever the problem is.
joe
Post by Doug Harrison [MVP]On Wed, 25 Jul 2007 15:53:39 -0400, Joseph M. Newcomer
Post by Joseph M. NewcomerYes, it must be 'A' not 'a'. The value 'a', 0x61, is actually VK_NUMPAD1.
But why not check for WM_CHAR and ask if it is 0x0001, the value of control-A as a
character.
1. Ctrl+A might be bound to an accelerator, in which case, you won't get a
WM_CHAR.
2. I don't know the numeric value of Ctrl+A and don't want to know. :) Is
it even the same for every keyboard and every localized Windows?
Joseph M. Newcomer [MVP]
email: ***@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm