Re: Determining XKeysyms



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. 

What format is required of the "character" that you pass to vkkeyscan?

I believe one of the reasons for the complexity of the X APIs is the
fact that they are totally general, and client-server/multilocale
besides.

There is a way to do something like SendInput using a compose-sequence,
but for full-blown support it looks as though you have to implement an X
Input Method yourself, yuck.

Support for getting strings from complex key sequences is much easier,
but synthesizing the strings is not as easy.

> 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.

This sounds to me like a simple lookup from keysymdefs.h.

- Bill

-- 
Bill Haneman <bill haneman sun com>




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