LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-30-2009, 04:39 PM   #1
10110111
Member
 
Registered: Jun 2008
Location: St.-Petersburg, Russia
Distribution: (B)LFS, Ubuntu, SliTaz
Posts: 403

Rep: Reputation: 51
Emulate key press while not being root


How can i emulate key press in X Window system, as acpi_fakekey does, but without need to be root?
 
Old 08-31-2009, 10:21 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian + kde 4 / 5
Posts: 6,842

Rep: Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003Reputation: 2003
You're looking for xdotool.

Code:
xdotool key "ctrl+alt+S"       #simulate a button combination

xdotool type "Hello world!"    #"type" a text string

xdotool click 3                #emulate a mouse click
There are also older options, like xmacroplay and xvkbd, but you don't want to use them. xdotool does it better.
 
1 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emulate Ctrl-d with Delete key in ksh lucmove Programming 2 07-03-2009 07:08 AM
Emulate joy or letter key mjnman Linux - Software 3 02-26-2009 02:33 AM
Emulating a key press simopal6 Linux - General 1 12-13-2007 12:53 PM
key press detecting ilnli Programming 2 07-16-2007 02:24 AM
Key press Majestros Programming 2 02-14-2007 03:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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