Dmitry Timoshkov wrote:
Hello,
note to Shachar:
this implementation doesn't really work due to "merged" keyboard layouts we have. I.e. since we have Israelian keyboard layout with both english and hebrew characters, after the MappingNotify event we're still using the same keyboard layout with same LCID identifier, and applications receive WM_INPUTLANGCHANGE(REQUEST) with the same, not changed keyboard layout identifier.
You can make it work though, using an ugly workaround:
setxkbmap us wine WINWORD.EXE
type something in Word, then in another xterm and run setxkbmap ru
switch back to Word and continue typing. Word will see the change and kindly reflect that in the status bar.
In order to experiment with Hebrew you need to create a pure Hebrew keyboard layout in Wine, and use 'setxkbmap il'.
Perhaps a way to go is to handle X layout switch notification event and figure out what layout is really used from the merged mapping we currently have. So far I have no an idea how to do that.
I had an idea, but I have not even began to look at it. I'm currently still sharing my time on Wine between the unicows thingy and revamping the BiDi support.
The idea I had, for which I cannot state whether it's feasible or not, is to get the mapping from XKB, and prepare a list (group 0 - US, group 1 - IL, group 2 - RU). Then, whenever we get a "next group" or "prev group", just send out the proper messages. This way, we can also switch keyboard language at an application's whim (I actually have a small snippet of code that does that, if your'e interested).
As far as I see it, using "setxkbmap" with a new layout is akin to entering the keyboard control panel applet and changing the layout, rather than to using "alt-shift".
I fully understand that some applications do that anyhow. In particular, KDE's keyboard switching is based on calling setxkbmap. I think that would still work (though it may send an "settingschanged" message).
Anyhow, your current code (which I have not dived into, yet) should probably go in. It seems to prepare important infrastructure for handling keyboard languages by the X11 driver.
Shachar
"Shachar Shemesh" wine-devel@shemesh.biz wrote:
The idea I had, for which I cannot state whether it's feasible or not, is to get the mapping from XKB, and prepare a list (group 0 - US, group 1 - IL, group 2 - RU). Then, whenever we get a "next group" or "prev group", just send out the proper messages. This way, we can also switch keyboard language at an application's whim (I actually have a small snippet of code that does that, if your'e interested).
I'm afraid that will not work, since we need to attach an XKB mapping
Anyhow, your current code (which I have not dived into, yet) should probably go in. It seems to prepare important infrastructure for handling keyboard languages by the X11 driver.
Perhaps I exaggerated a bit a problem for you. After a little of thinking I believe you could try:
1. remove all existing israelian keyboard layouts from x11drv/keyboard.c 2. create a new israelian layout (by simply editing an existing one and removing english characters) which will work in Wine after 'setxkbmap il'. 3. configure your XFree86 to have distinct "us" and "il" layouts.
#3 possibly is a most difficult step. At least I don't know how to do that using standard approaches provided by XF86Config.
After that, MappingNotify should really do its work and make Wine to change internal keyboard layouts and therefore HKL identifier.
Dmitry Timoshkov wrote:
"Shachar Shemesh" wine-devel@shemesh.biz wrote:
The idea I had, for which I cannot state whether it's feasible or not, is to get the mapping from XKB, and prepare a list (group 0 - US, group 1 - IL, group 2 - RU). Then, whenever we get a "next group" or "prev group", just send out the proper messages. This way, we can also switch keyboard language at an application's whim (I actually have a small snippet of code that does that, if your'e interested).
I'm afraid that will not work, since we need to attach an XKB mapping
Anyhow, your current code (which I have not dived into, yet) should probably go in. It seems to prepare important infrastructure for handling keyboard languages by the X11 driver.
Perhaps I exaggerated a bit a problem for you. After a little of thinking I believe you could try:
- remove all existing israelian keyboard layouts from x11drv/keyboard.c
- create a new israelian layout (by simply editing an existing one and
removing english characters) which will work in Wine after 'setxkbmap il'. 3. configure your XFree86 to have distinct "us" and "il" layouts.
#3 possibly is a most difficult step. At least I don't know how to do that using standard approaches provided by XF86Config.
After that, MappingNotify should really do its work and make Wine to change internal keyboard layouts and therefore HKL identifier.
XFree 4.3 would do about this. setxkbmap il would only give Israeli keyboard layout. In order to get the current behaviour, one would have to do "setxkbmap us,il". Is that what you mean?
If that is the case, then merely removing the English part of the keyboard from the Israeli Wine mapping should identify it as a US keyboard followed by an Israeli keyboard. Is that what you mean?
[this time to the list in order to mark this as answered]
"Shachar Shemesh" wine-devel@shemesh.biz wrote:
XFree 4.3 would do about this. setxkbmap il would only give Israeli keyboard layout. In order to get the current behaviour, one would have to do "setxkbmap us,il". Is that what you mean?
If that is the case, then merely removing the English part of the keyboard from the Israeli Wine mapping should identify it as a US keyboard followed by an Israeli keyboard. Is that what you mean?
That's right.