On Tue, 29 Mar 2005 18:25:37 +0100, Bill Haneman <[EMAIL PROTECTED]> wrote:> > >For keycodes, wont any java code that return them have to communicate > >with X? Its my understanding that keycodes change depending on what > >keyboard is plugged in (I could be wrong). So, essentially the java > >program will have to return the X keycodes. Right? > > > I am doubtful.
Hmm, perhaps I am mistaken. I have not actually tested this out to confirm it. The reason I think this is because when you look at under /usr/X11R6/lib/X11/xkb/keycodes there are multiple files, each defining keycodes for various keyboards. Looking into these files it is clear that a keycode for a particular key on one keyboard does not correspond to the same key on another keyboard. Also, the x function to get keycodes (XKeysymToKeycode) does not only take a keysym, but it also need a reference to which display is being used. Like I have said I have not tested this, but I will when I can get my hands on another keyboard. > > >You are right that I could just use just be using strings instead of > >keysyms or keycodes, if I was just trying to mimic a single keypress. > >But to generate more complex keyboard events (ie ctrl alt R), you > >would need to use keycodes (cause they are the only ones with key > >press and release capabilities). > > I'll have another look at the implementation, to see if there is > something better that we can do. I do wonder, however, why a Java > application, even an assistive technology, needs to synthesize specific > keycode sequences. What are you trying to do, again? I am trying to write an onscreen keyboard (for my tablet pc). This is why I need to be able to implement complex keystrokes. I do realise that there are already onscreen keyboard out there, but none of them are as simple or intuitive as I would like. I know I could write this in C and use X methods to find the keycodes and keysyms, but if the Java Access Bridge can call generateKeyboardEvent and it uses keysyms and keycodes, shouldn't there be a away in java to get them? Thanks, Matt Wringe _______________________________________________ Gnome-accessibility-devel mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gnome-accessibility-devel
