Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 01-16-2012, 11:23 AM   #1
Registered: Sep 2010
Posts: 78

Rep: Reputation: 2
Gnome/metacity keybinding won't permit program to wait for a keystroke,


I have a little GUI utility written in C that requires the user to press a key to make a menu selection. The code is predictably simple:

system("stty raw");
save_ID = getchar();
system("stty cooked");

'getchar()' grabs the keystroke and the two 'system' lines make it so that it doesn't need to wait for ENTER. It works fine from the command line, however, when I bind the command to a hotkey in Gnome with metacity, it waits for the keystroke alright, but the keystroke then seems to be processed not as as input to the command as it should, but as if it were a separate command. Eg. if my keystroke is "1" and I'm in a terminal I see:

"zsh: command not found: 1"

A non-interactive version of the program works fine when bound to a hotkey, so the program is basically functional, it just can't be used interactively when called via a hotkey. Is there anything I can do about this? If metacity won't cooperate, is there some other macro/hotkey utility that would grab the keystroke properly?



gnome, hotkey, metacity

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
Gnome Keybinding samkhanski Linux - Newbie 0 01-01-2007 12:58 PM
keybinding not working in gnome kg4ysy Linux - Software 1 04-21-2006 10:07 AM
Gnome Keybinding issue runlevel0 Linux - Software 0 12-09-2005 09:54 AM
Program for keybinding of Multimedia buttons on keyboard alitrix Linux - Software 24 10-17-2004 07:23 PM
missing gnome option in gnome-keybinding-properties fedora core 1? lrt2003 Fedora 0 04-18-2004 07:35 PM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:33 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