Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting Alt-Shift pression or language change
Message
 
To
13/02/2009 09:11:28
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01381559
Message ID:
01381572
Views:
61
Hi Reza,

The simplest way to find out which keyboard layout is active, would be to call GetKeyboardLayout API function (or GetAsyncKeyState) every second using a Timer. That should not slow down an application too much.

By the way, user can choose some other combination of keys, not ALT+SHIFT, to switch between keyboard layouts.

* * *
As for monitoring the keyboard state, API functions like WaitForSingleObject normally should be called in separate threads, which is not an option for VFP. The SetWindowsHookEx is not an option either because of callback procedures.

* * *
I will check other options and will let you know if I find anything.
Previous
Reply
Map
View

Click here to load this message in the networking platform