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

Re: kbd raw mode in terminal emulator



On Tue, 2012-01-10 at 11:01 +1100, Scott Ferguson wrote:
> On 10/01/12 10:36, Maroš Žilka wrote:
> > Hi list,
> > 
> > I am making little game with ncurses and I need to now when is some key
> > pressed or released ( of course this must be non-blocking ) so I think
> > the only way to do this is set the keyboard to raw mode, this work nice
> > in virtual console but i can not switch mode in Gnome terminal (or any
> > terminal emulator ) is there any way to do this ? If no how can I most
> > easily check state of keys.
> > 
> > Thank you.
> > 
> > Maros.
> > 
> > 
> 
> wgetch()

Problem with wgetch() is that I need to know when certain key is pressed
or released but wgetch only reads stdin and tell you what is there so
for example in my game when i press 's' my character moves one tile down
( because i typed s ) then he stop for short time and again start to
move down ( that's because the pressed key starts repeatedly print the
char to stdin... )

> 
> Perhaps I'm misunderstanding your question. Have you tried xev?

xev is interesting but I don't know how could it help me
> 
> 
> 
> Cheers
> 
> -- 
> Iceweasel/Firefox extensions for finding answers to Debian questions:-
> https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/
> 
> 



Reply to: