thedardanius
February 16th, 2013, 03:47 PM
hey,
Im trying to get the keyboard input in this way:
if one key is pressed, check the keycode. Put this in an array of bools (bool[256]), to check and store which keycodes are on/off with keypressmaks and keyrelease.
However, what next?? I know keycodes are the "raw" data returned from some processing though drivers and hardware and kernel, but what then? Do I need to do sth with keysym? I know that keycodes do not have determined actual keys, so e.g. code 2 isnt always key "A" or "enter". How can I decode this chaos into actual physical keys, so I can create my game? Isnt there sth like virtual key codes in windows, which does have determined physical keys connected to each code?
BTW, when I press a key, I never get focus. So my app is in front, (assume it has focus) and I press eg.g a. Keypress event doesnt return a to be true (at least the translated keysym isnt there). nstead, other programs get the input. How come? How can I get full autonomous focus of one keyboard?
Finally, does anyone know a decent rather complete beginner's tutorial on xlib and preferable glx? I really need some decent material to learn it....
And another thing, why is my glx xlib app so laggy? Is this due to the fact that the client has to wait for the server, or simply because of me (actually you cant really know cause you havent seen the code. However, I would appreciate it if you would give me some potential factors contributing to lagginess in an glx program).
Im new to linux. I like it, I like the new xlib system/glx, but its so hard for a beginner. I alsodislike that fact that there so many independant window managers, all having different things and casuing xlib not to have full control of the window system, altough xlib wasnt designed for that i thought...
Im trying to get the keyboard input in this way:
if one key is pressed, check the keycode. Put this in an array of bools (bool[256]), to check and store which keycodes are on/off with keypressmaks and keyrelease.
However, what next?? I know keycodes are the "raw" data returned from some processing though drivers and hardware and kernel, but what then? Do I need to do sth with keysym? I know that keycodes do not have determined actual keys, so e.g. code 2 isnt always key "A" or "enter". How can I decode this chaos into actual physical keys, so I can create my game? Isnt there sth like virtual key codes in windows, which does have determined physical keys connected to each code?
BTW, when I press a key, I never get focus. So my app is in front, (assume it has focus) and I press eg.g a. Keypress event doesnt return a to be true (at least the translated keysym isnt there). nstead, other programs get the input. How come? How can I get full autonomous focus of one keyboard?
Finally, does anyone know a decent rather complete beginner's tutorial on xlib and preferable glx? I really need some decent material to learn it....
And another thing, why is my glx xlib app so laggy? Is this due to the fact that the client has to wait for the server, or simply because of me (actually you cant really know cause you havent seen the code. However, I would appreciate it if you would give me some potential factors contributing to lagginess in an glx program).
Im new to linux. I like it, I like the new xlib system/glx, but its so hard for a beginner. I alsodislike that fact that there so many independant window managers, all having different things and casuing xlib not to have full control of the window system, altough xlib wasnt designed for that i thought...