Re: Re: Emulation of Alt+Numpad+Digits behavior
"Dave Williss" <[email protected]>
| Newsgroups | gmane.comp.xfree86.internationalization |
|---|---|
| Message-ID | <0fd501c47a77$7e6bafe0$6e00000a@opus> |
Our Windows X server product (http://www.microimages.com/mix/) used to use a method very similar to this to transmit characters received from the Windows Japanese IME and other keyboard layouts. Our "trick" was to flag them specially by sending a key code which would turn the Mod3 mask on followed by two up/down pairs whose keycodes were the first and 2nd byte of the Shift-JIS code for the character. Then send the keycode to turn Mod3 off. Very "clunky" and, yes, you had to modify clients to understand it. We eventually came up with a better solution which works much better. First, we got to the point that we could generate the correct X Keysym for any Unicode value. Then, when reserved a section of keycodes in our keymap (32 values, I think). When we want to send a code from the IME, we look through the keymap to see if it's already in there and send the keycode if it is. If not, we take one of the 32 keycodes that we reserved and change its Keysym and then send an event indicating that we've changed the keymap. We also keep a 'least-recently-used' list of the reserved keycodes to reduce the number of times you have to transmit the whole keymap. This solution isn't real pretty either, but it's better than the first one and has the advantage that no changes are required to any client programs. For most languages 32 remappable key codes is enough to handle everyday typing. For Asian languages it's not, the overhead of sending the keymap hardly noticeable. ----- Original Message ----- From: "Alan Coopersmith" <[email protected]> To: <[email protected]>; <[email protected]> Sent: Wednesday, August 04, 2004 10:00 AM Subject: [I18n] Re: Emulation of Alt+Numpad+Digits behavior > I'm not familiar with all the details, but it sounds like this may be > easiest done by adding a new input method on the client side - I've > cc'ed the i18n list in the hopes someone there can confirm or deny my > suspicion. > > -Alan Coopersmith- [email protected] > Sun Microsystems, Inc. - X Window System Engineering > > Jörg Henne wrote: > > Hi, > > > > well, even after digging through lots of source code and documentation, > > I could really use some help. What I am trying to do is to emulate the > > MS-Windows behaviour which lets one enter arbitrary characters by using > > the Alt-Key while entering the character code on the numerical keypad. > > > > What would have to happen in order to emulate this feature is pretty > > simple: after releasing the Alt-Key, two (down/up) extra events would > > have to be sent which carry the keysym for the character which has been > > entered. However, this is not possible because the events carry just the > > keycodes and not keysyms. > > > > I currently see two solutions: > > - To add some code to the keyboard driver which synthesizes the events > > using a keysym-to-keycode lookup. This poses some problems: what happens > > if no corresponding keycode exists for thei given keysym? And how does > > this go together with xkb processing? > > > > - To extend Xlib so that the emulation happens on the client side. Of > > course this brings up even bigger problems: is there a central and > > reliable place to do this? XLookupKeysym and friends would have to keep > > some state and work together with some event dispatching magic. That > > doesn't really sound healthy. > > > > Well, that's it for now. Any help would be very greatly appreciated. > > Joerg Henne > > > > _______________________________________________ > > Devel mailing list > > [email protected] > > http://XFree86.Org/mailman/listinfo/devel > > > _______________________________________________ > I18n mailing list > [email protected] > http://XFree86.Org/mailman/listinfo/i18n