469,366 Members | 2,254 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

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 687

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
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.