Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-13-2009, 03:04 AM   #1
LQ Newbie
Registered: Mar 2009
Posts: 28

Rep: Reputation: 15
Unhappy C program to perform an operation continuously until user presses a key


em writing a program , where i need to call the ioctl() function continuosly until user presses a key.i tried all possibilities but could'nt figure out.

thanks in advance!!!
Old 03-13-2009, 05:42 AM   #2
Registered: Oct 2003
Location: UnitedKingdom
Distribution: Debian Bullseye
Posts: 357

Rep: Reputation: 49
use ncurses function wgetch/mvwgetch
this will return when you just press a key (no need to press enter)
Old 03-13-2009, 08:59 AM   #3
Registered: Dec 2008
Posts: 31

Rep: Reputation: 16
it is the long time since i wrote programs, so i may be not correct. you can try to make 2 threads - one for ioctl(), second for checking for keypress. if the key is pressed, keypress thread stops the ioctl() thread.
Old 03-13-2009, 10:29 AM   #4
LQ Newbie
Registered: Mar 2009
Posts: 28

Original Poster
Rep: Reputation: 15

hey thanks a lot for your suggestion.em using kernel threads !!!
Old 03-13-2009, 10:59 AM   #5
LQ Newbie
Registered: Mar 2009
Posts: 28

Original Poster
Rep: Reputation: 15

hey thanks man.i read abt the ncurses's mvgetch(y,x) macro yo mentioned. can you temme how should i use this function??em not clear abt this. .


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
wxwidgets / wxpython: grab global key presses eventhough frame is not in focus? browny_amiga Programming 3 04-10-2009 11:38 PM
Perform an operation on files x, output to x.out, y.out respectively johndoe0028 Linux - General 6 04-02-2006 11:39 PM
Simulating Key Presses Hal Programming 2 09-02-2005 06:05 PM
Detecting Arrow Key Presses in C / C++ BooKA. Programming 8 04-07-2004 07:10 AM
How to listen to all key presses in whole Linux? pvv Programming 1 03-28-2004 02:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:39 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration