How can I Handle character 'a' and character 'A' in pretranslate Message
-
I think if u handle WM_CHAR instead of WM_KEYDOWN, you can identify 'a' and 'A'.
nave [OpenedFileFinder]
Thanks for the Reply... But i have some problem when using WM_CHAR and WM_KEYDOWN message maps. So,Can i Handle it in "PreTranslateMessage".. any suggestions.......
-
Thanks for the Reply... But i have some problem when using WM_CHAR and WM_KEYDOWN message maps. So,Can i Handle it in "PreTranslateMessage".. any suggestions.......
yes.
nave [OpenedFileFinder]
-
Thanks for the Reply... But i have some problem when using WM_CHAR and WM_KEYDOWN message maps. So,Can i Handle it in "PreTranslateMessage".. any suggestions.......
You may use
GetKeyState(VK_SHIFT)
[^] to distinguish between lower case and upper case keys inPreTranslateMessage
. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
You may use
GetKeyState(VK_SHIFT)
[^] to distinguish between lower case and upper case keys inPreTranslateMessage
. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]CPallini wrote:
You may use GetKeyState(VK_SHIFT) [^] to distinguish between lower case and upper case
And when caps Lock Key is on? :-D
nave [OpenedFileFinder]
-
CPallini wrote:
You may use GetKeyState(VK_SHIFT) [^] to distinguish between lower case and upper case
And when caps Lock Key is on? :-D
nave [OpenedFileFinder]
Make a try before arguing ;P (i.e.
CAPS LOCK
key down makesGetKeyState(VK_SHIFT)
returning the same value it returns wheneverSHIFT
key is held down) :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Make a try before arguing ;P (i.e.
CAPS LOCK
key down makesGetKeyState(VK_SHIFT)
returning the same value it returns wheneverSHIFT
key is held down) :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]CPallini wrote:
Make a try before arguing
But I tried now. GetKeyState(VK_SHIFT) is not giving the same value when shift key is down and when CAPS LOCK key is on. Did you actually check like this..?
if( GetKeyState(VK_SHIFT)&0x8000 )
nave [OpenedFileFinder]
-
CPallini wrote:
Make a try before arguing
But I tried now. GetKeyState(VK_SHIFT) is not giving the same value when shift key is down and when CAPS LOCK key is on. Did you actually check like this..?
if( GetKeyState(VK_SHIFT)&0x8000 )
nave [OpenedFileFinder]
Well, actually it is not the same value, but bit
0
contains the meaningful info in both cases, henceGetKeyState(VK_SHIFT) & 0x0001
should do the trick. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Well, actually it is not the same value, but bit
0
contains the meaningful info in both cases, henceGetKeyState(VK_SHIFT) & 0x0001
should do the trick. :)If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]CPallini wrote:
hence GetKeyState(VK_SHIFT) & 0x0001 should do the trick.
I dont think so. Cause the low bit indicates the key is toggled. Suppose the application is started and at that state if( GetKeyState(VK_SHIFT) & 0x0001) - > will return false. Then I press shift key and release it. After that if( GetKeyState(VK_SHIFT) & 0x0001) - > will return true. Then if i again press shift and release, if( GetKeyState(VK_SHIFT) & 0x0001) - > will return false. So basically, checking the 0 bit have no meaning in the case of shift key. 0th have use only in the case of toggle keys such as CAPS LOCK, NUM LOCK etc...
nave [OpenedFileFinder]
-
CPallini wrote:
hence GetKeyState(VK_SHIFT) & 0x0001 should do the trick.
I dont think so. Cause the low bit indicates the key is toggled. Suppose the application is started and at that state if( GetKeyState(VK_SHIFT) & 0x0001) - > will return false. Then I press shift key and release it. After that if( GetKeyState(VK_SHIFT) & 0x0001) - > will return true. Then if i again press shift and release, if( GetKeyState(VK_SHIFT) & 0x0001) - > will return false. So basically, checking the 0 bit have no meaning in the case of shift key. 0th have use only in the case of toggle keys such as CAPS LOCK, NUM LOCK etc...
nave [OpenedFileFinder]
Again, make a test. (I did). :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
Again, make a test. (I did). :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Thanks... GetKeyState() works fine.... Regards varma
-
Thanks... GetKeyState() works fine.... Regards varma
phanindra varma wrote:
Thanks...
You're welcome.
phanindra varma wrote:
GetKeyState() works fine....
Sure. :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]