Get Keyboard Keys?

Linux specific forum
GBeebe
Enthusiast
Enthusiast
Posts: 263
Joined: Sat Oct 09, 2004 6:52 pm
Location: Franklin, PA - USA
Contact:

Get Keyboard Keys?

Post by GBeebe »

I'm trying to write a gui for my game. The game uses SDL, but the gui part, for selecting a level, adjusting sound volume, and configuring keys, is just a normal window using openwindow() and gadgets.

What i need is a way to get what key is pressed after the user clicks on a button, for the key config section. Any ideas?

PS, I'm doing it this way, cause it's quicker than designing one inside the game screen.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Maybe a GTK treeview with a GtkCellRendererAccel could be used?
GBeebe
Enthusiast
Enthusiast
Posts: 263
Joined: Sat Oct 09, 2004 6:52 pm
Location: Franklin, PA - USA
Contact:

meh.

Post by GBeebe »

meh. Sounds like it will just be easier to display a small SDL window displaying a "Press Button" message in it. And wait for an sdl keyboard event.
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 576
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

Post by bembulak »

It should not be a problem, setting the focus to a stringgadget() and catching the input.
cheers,

bembulak
GBeebe
Enthusiast
Enthusiast
Posts: 263
Joined: Sat Oct 09, 2004 6:52 pm
Location: Franklin, PA - USA
Contact:

nope

Post by GBeebe »

That won't work for special keys like Shift, Alt, Arrow keys, etc...
Post Reply