[Kde-games-devel] raw keyboard events (via callback)

P. George invest at juun.com
Thu Sep 16 03:38:10 CEST 2004


THE STORY BEHIND THE QUESTION:

i am (as i mentioned in a previous post) porting a mac application to 
linux (well, from windows to mac to linux).  it's being built in 
realbasic (on the mac), which is a sort vb-like language.  the reason 
i'm moving to realbasic is solely because, your app can, in a single 
click, be cross-compiled for several operating systems, including 
linux.

here's the catch:  if there are any library calls that need to be made, 
it basically has to be done per-os at the pre-processor stage:

#IF TargetMacOS
	//mac-specific library calls here
#ELSEIF TargetWin32
	//windows-specific library calls here
#ELSEIF TargetLinux
	//linux-specific library calls here
#ENDIF

in realbasic, you can only get keydown events on keys that result in a 
printed character.  you cannot get event notification of changes in the 
state (up/down) of the modifier keys on any of the supported target 
systems without a couple library calls and a custom callback.  i've 
just completed a 3-day adventure, getting this to work on the mac.  now 
it's time to do the same on linux.  then i'll have to do it all again 
on windblows.

i've done a little googling on this subject today, but found nothing 
concrete, so i figure i'll cut to the chase and just ask you guys/gals.

and PLEASE don't worry about the fact that this is in another 
programming language.  that is truly NOT a problem.  i have years and 
years of C/C++ experience (and many others) and i've programmed on 
linux before, and whatever code you provide or refer me to can 
certainly be made to work in realbasic.  pascal.... fine.  whatever.  
just knowing the name of the lirary call and the library it's in is 
probably enough to get me by.  whatever library contains the hooks i'll 
call directly from realbasic.  it's not too hard, especially now that 
i've been at it for a few days.




THE QUESTION:

so, just pretend this is a C/C++ question:

what library call(s) do i need to make to get RAW key deltas for ALL 
keys (or at least just the modifier keys -- shift, ctrl, win?, alt) via 
events sent to a callback?

please keep in mind that the whole point of this is to avoid having to 
continually poll the state of the modifier keys, which is already 
something i can do in realbasic.

no polling.

just events triggered by keydowns/keyups for the modifier keys (or the 
whole keyboard, INCLUDING the modifier keys).

thanks.

- philip





More information about the kde-games-devel mailing list