Re: Determining XKeysyms



Hi Matthew:

I have a new (simple) suggestion for you regarding XKeysyms (see
below).  

On Tue, 2003-03-04 at 05:50, Matthew Garrett wrote:
> On Mon, Mar 03, 2003 at 01:24:49PM +0000, Matthew Garrett wrote:
> 
> > That would be great from my point of view, but implementing something 
> > myself is also an option. I also need to look into the Windows interface 
> > for this stuff and see what messy details I need to go into there.
> 
> For anyone who's interested: Windows provides two mechanisms for this, 
> the availability of which depends on the version.
> 
> 1) vkkeyscan will take a character and turn it into the corresponding
> virtual-key code *and shift state* for the current keyboard. The
> vkkeyscanex version lets you choose any loaded keymap, so I can load a
> keymap corresponding to the loaded Dasher alphabet, generate a keycode
> and then send it to the application using kbd_event without having to
> know anything about the user's keyboard.
> 
> 2) In Windows 2000 and later, I can use SendInput with a kbdinput 
> structure. I can simply stuff a UTF8 character into this and magic stuff 
> that I probably don't want to understand happens.
> 
> So, at the moment, it looks significantly easier to do this with Windows 
> than X. Another application that I looked at that's doing something 
> similar under X11 is Xstroke, which is an on-screen scribbling input 
> thing. It seems to use an X keysym lookup defined in its alphabet, but I 
> didn't check how comprehensive its list of characters was.

For some reason I was forgetting a much easier way to do this, when I
replied before.  Interestingly, nobody else reading this list caught my
omission :-)

You can try XStringToKeysym(), which works for any string that has a
corresponding KeySym with the current keyboard driver.  For anything
other than "exotic" multi-language cases this should work fine for
Dasher, in terms of converting from strings to KeySyms.

AT-SPI allows synthesis of input on keysym basis, so that's all you
really need; however if you want to figure out what possible hardare
keycodes can generate that keysymbol, there is also XKeycodeToKeysym in
Xlib.

So it's really not too difficult in X + at-spi, just

XStringToKeysym() followed by
SPI_generateKeyboardEvent ().

regards,

Bill

-- 
Bill Haneman <bill haneman sun com>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]