[ros-dev] kbswitch update

Colin Finck colin at reactos.org
Mon Dec 7 03:48:28 UTC 2015


Hi,

Let me at least answer one of your questions before these get lost in
the discussion.

Am 03.12.2015 um 23:03 schrieb Hans-Peter Diettrich:
> Q: Is kbswitch notified of focus changes, and if so: how?

As you have already found out, kbswitch has been implemented as a
system-wide keyboard layout switcher and not a per-application one.
Therefore, it doesn't care about focus at all.

A proper per-application keyboard layout switcher as part of the
Language Bar should also be implemented as a shell extension instead of
a tray icon to be as flexible as the Windows original.
To get notified of focus changes, an application should probably hook
the EVENT_SYSTEM_FOREGROUND event using the SetWinEventHook API. The
rest can be done using calls to GetForegroundWindow,
GetWindowThreadProcessId and GetKeyboardLayout as you already suggested.

Unfortunately, I lack deeper experience with keyboard layout internals,
so this is all I can tell you for now.
You may find someone in #reactos or #reactos-dev on IRC with more
expertise on this.

Cheers,

Colin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4236 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20151206/287adc90/attachment-0001.bin>


More information about the Ros-dev mailing list