![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
Ubuntu 9.10 is out!!!
When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu. The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely. |
|
The Community Cafe The Community Chat area is for lighthearted and enjoyable discussions, like you might find around a water cooler at work. Almost any non-tech-support topic may be discussed here. Discussions on religion and politics are not allowed, except for politics directly related to free and open source issues. Any topic or discussion that causes problems or drama will be closed. This area is intended for fun and community building, not arguments. Please take those elsewhere. Thanks! |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Dark Roasted Ubuntu
![]() Join Date: Jul 2006
Beans: 1,008
|
[SOLVED] How do I run a key press as a command?
I am not looking to assign commands to keyboard keys, but rather the other way round. I am looking for an application that allows me to run the pressing of a key on my keyboard as a command. In other words, that if I run command xyz it is the equivalent of pressing key a.
I've been looking for it on these and other Linux forums, and on Google, but haven't had much success yet. I hope it is possible, as every key has a unique code that could perhaps be simulated on the command line by a particular application. Any suggestions anyone? |
|
|
|
|
|
#2 |
|
Just Give Me the Beans!
![]() Join Date: Dec 2007
Location: Sweden
Beans: 78
Ubuntu Jaunty Jackalope (testing)
|
Re: How do I run a key press as a command?
Sounds like you are trying to create a macro on the keyboard. So that for example: Ctrl+Alt+F1 is equivalent to Ctrl+F1
Am I right? https://help.ubuntu.com/community/MultimediaKeys that link might help? |
|
|
|
|
|
#3 |
|
Dark Roasted Ubuntu
![]() Join Date: Jul 2006
Beans: 1,008
|
Re: How do I run a key press as a command?
No.
|
|
|
|
|
|
#4 |
|
Just Give Me the Beans!
![]() Join Date: Jan 2007
Location: CA (Canada? I wish.)
Beans: 79
Xubuntu 7.10 Gutsy Gibbon
|
Re: How do I run a key press as a command?
I am screaming at my keyboard "NO! NO!" when I read scizzo's response.
I am looking for the EXACT same thing!! If you find it, I want to know about it! Hey, just got a thought.... maybe we should look at the source code for the gnome on screen keyboard.... Edit: Looking at onboard's source... it's not very clear to me... it uses GDK...and some object oriented programming that I don't understand in python yet.
__________________
Cows go moo. Quite a concept, eh? Last edited by SoulinEther; January 4th, 2008 at 11:33 PM.. |
|
|
|
|
|
#5 |
|
A Carafe of Ubuntu
![]() |
Re: How do I run a key press as a command?
Why do you need to output key presses? Why not just run the command you want from the command line? Or output the text you want if that is what you are trying to do?
|
|
|
|
|
|
#6 |
|
5 Cups of Ubuntu
![]() Join Date: Oct 2007
Location: Southern Maryland, USA
Beans: 33
Ubuntu 7.10 Gutsy Gibbon
|
Re: How do I run a key press as a command?
You want to trigger a keypress event, right? What programming language (makes a difference)? Does this link help? http://www5.experts-exchange.com/Pro..._20460831.html
Last edited by cwej; January 5th, 2008 at 12:46 AM.. Reason: clarity |
|
|
|
|
|
#7 |
|
Loony Lycanthrope
![]() Join Date: Jul 2005
Beans: 6,863
|
Re: How do I run a key press as a command?
Is btnx what you are looking for?
|
|
|
|
|
|
#8 | |
|
Ubuntu Extra Shot
![]() |
Re: How do I run a key press as a command?
What are you using it for?
__________________
Quote:
|
|
|
|
|
|
|
#9 |
|
Just Give Me the Beans!
![]() Join Date: Jan 2007
Location: CA (Canada? I wish.)
Beans: 79
Xubuntu 7.10 Gutsy Gibbon
|
Re: How do I run a key press as a command?
K, well, for me... it's probably best that I don't use it to issue a keyboard command, but I just wanted it as a bandaid solution.
I want to make a new Xfce panel that displays the name of the active window (this part i have not figured out...), and provides functionality to close, minimize, restore, etc the active window. Xfce's default shortcuts are like Alt+F5 to grow/shrink, Alt+F8 to minimize, etc..... Because I don't want to go through the hell of figuring out how to directly call for the minimizing of the current window, (though i'm sure it's closely related to finding out what the title of the active window is), I wanted this bandaid solution to just press Alt+F5 on launching a script or quick program. I think it would involve the use of GDK, at least for GTK purposes.... Or does someone know how to make direct X event calls or whatever? .. (and for that matter, on the side, preferrably in python, could someone help me with how to manipulate an active window ? lol.) Thanks.
__________________
Cows go moo. Quite a concept, eh? |
|
|
|
|
|
#10 |
|
Skinny Soy Caramel Ubuntu
![]() Join Date: Jul 2007
My beans are hidden!
Ubuntu 8.04 Hardy Heron
|
Re: How do I run a key press as a command?
In that case I find the cure (simulating key strokes) worse than the ailment (wanting to manipulate a window), because I am sure that there must be an API do to just that.
However, I think there are solutions out there which do simulate keystrokes.
__________________
ch In Switzerland we make it other with apologies to Gerard Hoffnung |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|