FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 01-09-2012, 10:36 PM
Maroš Žilka
 
Default kbd raw mode in terminal emulator

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.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1326152182.29850.11.camel@lorien.home">http://lists.debian.org/1326152182.29850.11.camel@lorien.home
 
Old 01-09-2012, 11:01 PM
Scott Ferguson
 
Default kbd raw mode in terminal emulator

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()

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



Cheers

--
Iceweasel/Firefox extensions for finding answers to Debian questions:-
https://addons.mozilla.org/en-US/firefox/collections/Scott_Ferguson/debian/


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4F0B7FD5.1030905@gmail.com">http://lists.debian.org/4F0B7FD5.1030905@gmail.com
 
Old 01-09-2012, 11:42 PM
Maroš Žilka
 
Default 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/
>
>



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 1326156175.29850.23.camel@lorien.home">http://lists.debian.org/1326156175.29850.23.camel@lorien.home
 

Thread Tools




All times are GMT. The time now is 06:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org