Hi,
Is there a way to test the state of ALT Key just like CONTROL and SHIFT key.
In VKEY.CH I can find VK_CONTROL, VK_SHIFT but not VK_ALT
Regards
KeyState
KeyState
Gilbert Vaillancourt
turbolog@videotron.ca
turbolog@videotron.ca
Re: KeyState
is: VK_MENUGilbert wrote:Hi,
Is there a way to test the state of ALT Key just like CONTROL and SHIFT key.
In VKEY.CH I can find VK_CONTROL, VK_SHIFT but not VK_ALT
Regards
regards
William, Morales
Saludos
méxico.sureste
Saludos
méxico.sureste
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Hi,
Thanks for the hint it partly solved my problem.
But there`s something that I don`t understand.
If VK_MENU test the ALT key, Why VK_CONTROL test the CTRL and ALT keys.
I wrote this small piece of code for testing:
if GetKeyState(VK_MENU)
MsgInfo(`ALT key has been pressed`)
endif
if GetKeyState(VK_CONTROL)
MsgInfo(`CTRL key has been pressed`)
endif
If I press CTRL + 2 Message displayed is `CTRL key has been pressed`
If I press ALT + 2 Message displayed is `ALT key has been pressed` followed by `CTRL key has been pressed`
Why is VK_CONTROL also test the ALT key ?
Sould`nt it be testing the CTRL key only ?
Regards
Gilbert
Thanks for the hint it partly solved my problem.
But there`s something that I don`t understand.
If VK_MENU test the ALT key, Why VK_CONTROL test the CTRL and ALT keys.
I wrote this small piece of code for testing:
if GetKeyState(VK_MENU)
MsgInfo(`ALT key has been pressed`)
endif
if GetKeyState(VK_CONTROL)
MsgInfo(`CTRL key has been pressed`)
endif
If I press CTRL + 2 Message displayed is `CTRL key has been pressed`
If I press ALT + 2 Message displayed is `ALT key has been pressed` followed by `CTRL key has been pressed`
Why is VK_CONTROL also test the ALT key ?
Sould`nt it be testing the CTRL key only ?
Regards
Gilbert
Gilbert Vaillancourt
turbolog@videotron.ca
turbolog@videotron.ca
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Hi James,
I`m implementing new picture clause in the TGet. So far it works ok exept for one situation.
One picture clause I create allows the user to use FastLogin by using CTLR-G or whatever. (All 26 alpha key are available). Of course this FastLogin key has been configured in a User managament module where the user can create new users and define a FastLogin key.
So far, so good it works nicely. The only problem that this is causing me is whenever I have to capture an E-Mail address in a get field I cannot capture the @. TGet crashes. I figured out that it was because whenever the ALT Key is used it goes through the same routine that I added to the TGET that captures the FastLogin.
The strange thing about this is that the FastLogin should only work with CTRL Key. But I found out that using GetKeyState(VK_CONTROL) wich test the CTRL key also test the ALT Key. Because of this TGet crashes.
Finaly, I was able to work around the problem by doing the following:
do case
case GetKeyState(VK_MENU)
// Do Nothing
case GetKeyState(VK_CONTROL)
...
...
...
endcase
By testing VK_MENU (ALT key) first I eliminate the fact that using the ALT key GetKeyState(VK_CONTROL) processes the ALT + whaterver key may be used. This work around is quite weird but it works.
Regard,
Gilbert
I`m implementing new picture clause in the TGet. So far it works ok exept for one situation.
One picture clause I create allows the user to use FastLogin by using CTLR-G or whatever. (All 26 alpha key are available). Of course this FastLogin key has been configured in a User managament module where the user can create new users and define a FastLogin key.
So far, so good it works nicely. The only problem that this is causing me is whenever I have to capture an E-Mail address in a get field I cannot capture the @. TGet crashes. I figured out that it was because whenever the ALT Key is used it goes through the same routine that I added to the TGET that captures the FastLogin.
The strange thing about this is that the FastLogin should only work with CTRL Key. But I found out that using GetKeyState(VK_CONTROL) wich test the CTRL key also test the ALT Key. Because of this TGet crashes.
Finaly, I was able to work around the problem by doing the following:
do case
case GetKeyState(VK_MENU)
// Do Nothing
case GetKeyState(VK_CONTROL)
...
...
...
endcase
By testing VK_MENU (ALT key) first I eliminate the fact that using the ALT key GetKeyState(VK_CONTROL) processes the ALT + whaterver key may be used. This work around is quite weird but it works.
Regard,
Gilbert
Gilbert Vaillancourt
turbolog@videotron.ca
turbolog@videotron.ca
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact: