On Friday 04 July 2003 19:50, Shachar Shemesh wrote: > Hi all, > > This is for a good cause (I think - it's for making Wine work with Word > 2000 in Hebrew - you decide whether that's a good cause). I'm trying to > find APIs for the following: > 1. Knowing what the currently selected keymap is. Ideally, I want to > know that it's US,IL,RU and that we are currently on IL. This step is > not strickly speaking necessary, so long as step 2 and 3 are available > 2. Knowing what the actual details of the keymap are (i.e. - pressing > the key leftmost on the upper row produces a ~ etc). > 3. Knowing when the user switches between the groups (I think there is > an X event that notifies about that, so this may not be a major problem). > 4. Setting the current group! I want to say "I want the current group to > be 2 (RU)". > > If you know how to do it, I would be much obliged.
With the Xkb specs and some patience, it's pretty easy. I've implemented something similar on top of Qt -- something which recognizes when the keyboard is in an RTL language (to allow switching the cursor direction and treating input smarter) by checking if the current mapping has an RTL character (Arabic or Hebrew) in it. Here's the code, adapted for generic use (clean C, no Qt ties): http://bugzilla.gnome.org/show_bug.cgi?id=116626 If you also want the Qt patch, which might be clearer (I don't remember), mail me. ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]