LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 10-29-2012, 10:37 PM   #1
queries34986@gmail.com
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Rep: Reputation: Disabled
Question Running an application by pressing a key on keyboard


Hi,

I am a beginner to linux programming language and still learning how things work in linux, hence this doubt.

I want to run an application i.e. Twinkle to be specific on linux by pressing a key on my keyboard, to be specific the letter 'C'.How do i go about this. Please can you help!Its urgent.

waiting in anticipation

Thanks
jack

Last edited by queries34986@gmail.com; 10-30-2012 at 07:44 AM. Reason: Help its urgent!
 
Old 10-30-2012, 10:20 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
I'm not really sure, but it looks very strange for me. Using GUI the keyboard events are handled by the current application (determined by the focus), this can be hardly modified. You can implement an app to use your own handler, but it will only work when app is focused.
What kind of language do you plan to use?
 
Old 10-30-2012, 03:01 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
Most of the major desktop environments include some kind of hotkey system. Check your configuration system or try a google search or two.

There's also xbindkeys for a more system-agnostic solution.

But I don't think you want to run a command with just "C". How could you type that way? You need some kind of modifier key to combine with it or else you'll be constantly launching it.
 
Old 10-30-2012, 03:48 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 15,374

Rep: Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198Reputation: 2198
You'd be better off with a hot key as in combination of keys instead of a common key.
 
Old 10-31-2012, 01:40 PM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,158

Rep: Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223Reputation: 1223
You obviously don't want "c" to launch anything: if it did, you'd never have typed "Jack"! Usually one uses the Super key (the one with the Windows logo) in conjunction with another key, so I have
Super+f for the command "nautilus /"
Super+h for "nautilus"

With Mate, Xfce, or Gnome, there's a tool available to set up shortcuts in the menu.
If you are using KDE, you can set a shortcut for a particular program by using the menu editor, right clicking on the program, and choosing Properties. I don't know how you set complex commands, though.
 
Old 11-26-2012, 10:35 AM   #6
queries34986@gmail.com
LQ Newbie
 
Registered: Oct 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Question

Actually I am trying to implement a VOIP application with the help of twinkle software which is linux based.I want to launch this app whenever i press a single key e.g like in case of an intercom.

So my question is whether i need to program such a thing in linux or are there hotkeys or some app in linux to do the same?
 
Old 11-26-2012, 11:11 AM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,979

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
Quote:
Originally Posted by queries34986@gmail.com View Post
Actually I am trying to implement a VOIP application with the help of twinkle software which is linux based.I want to launch this app whenever i press a single key e.g like in case of an intercom.

So my question is whether i need to program such a thing in linux or are there hotkeys or some app in linux to do the same?
As many posters above already wrote: it has nothing to do with Linux. If you're running X11, it depends on your Windowmanager, read the documentation for your Windowmanager. I know Xmonad and fvwm2 very well and can say that for those it is relatively easy to configure a hotkey to launch an application.

Markus
 
  


Reply


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
key detection in c ankitm Programming 1 01-18-2012 08:15 AM
How to run VC# application in linux gaya3 Linux - General 3 07-02-2008 12:52 PM
application behavior detection shahg_shahg Linux - Software 2 04-30-2008 06:22 AM
detection of key-loggers pixellany Linux - Software 2 01-09-2008 01:33 PM
slow usb key detection davidsrsb Slackware 9 03-18-2007 04:56 AM


All times are GMT -5. The time now is 03:13 AM.

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