471,825 Members | 1,165 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,825 software developers and data experts.

Re: Detect a sequence of keystrokes in an os independent way

Hi!

I was able to do this in the following way:

import os

fKey= raw_input('')
if fKey=='ab':
print(os.listdir(os.getcwd()))
Is there a better way to do this?

Thanks,

Raj

On Wed, Aug 20, 2008 at 2:21 PM, Rajanikanth Jammalamadaka
<ra*********@gmail.comwrote:
Hi!

Can somebody tell me if there is an os independent way to detect a
sequence of key strokes. For example, I want to start some other
program once the user presses a couple of keys: ex: key a and then key
b

Thanks,

Raj

--
"For him who has conquered the mind, the mind is the best of friends;
but for one who has failed to do so, his very mind will be the
greatest enemy."

Rajanikanth


--
"For him who has conquered the mind, the mind is the best of friends;
but for one who has failed to do so, his very mind will be the
greatest enemy."

Rajanikanth
Aug 20 '08 #1
0 721

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by R. Rajesh Jeba Anbiah | last post: by
1 post views Thread by Scott Shaw | last post: by
6 posts views Thread by Kürþat | last post: by
13 posts views Thread by michael sorens | last post: by
2 posts views Thread by Justin | last post: by
5 posts views Thread by =?ISO-8859-1?Q?Marcel_M=FCller?= | last post: by
reply views Thread by Rajanikanth Jammalamadaka | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.