-1

Is it possible to make a keypress trigger in python? and if so, then what's the simplest approach to make it?

What I'm trying to accomplish is just to make a simple fake trigger, that by executing a function makes the system listen that I've pressed the key.

for example that in a code, that I have pressed the 'Page Up' Key. I am currently using Ubuntu 10.04 this is what I am looking for

#function for auto trigger key pressed
def autoPressedPageUp():
   pressed.key("PageUp")

#if it recieved a message from a network
#it will call the function of trigger
if recievedMessage:
   autoPressedPageUp()

is it possible?

BenMorel
  • 31,815
  • 47
  • 169
  • 296
gadss
  • 20,175
  • 36
  • 98
  • 147
  • Possible duplicate of http://stackoverflow.com/q/5714072, http://stackoverflow.com/q/11150966, http://stackoverflow.com/q/11597892, or http://stackoverflow.com/questions/136734 – icktoofay Sep 11 '13 at 02:44

1 Answers1

-1

Way back in Visual Basic, there was a feature called SendKeys. SendKeys functionality has been implemented in many languages. I would try this project for python. Have not used it myself.

Gary Walker
  • 8,315
  • 2
  • 17
  • 40