473,409 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

how to capture key pressing

Hi all. I'm searching for a module that permit me to costantly log every key
pressed on the keyboard and eventually assign it a function (e.g. when "esc"
is pressed: exit program").
Oct 10 '05 #1
3 2785
Hi,

Look at curses.

Philippe
billie wrote:
Hi all. I'm searching for a module that permit me to costantly log every
key pressed on the keyboard and eventually assign it a function (e.g. when
"esc" is pressed: exit program").


Oct 10 '05 #2
> Look at curses.

I was searching for something portable on multiple platforms.
Curses doesn't work on Windows.
Oct 10 '05 #3
"billie" <ml***@fastwebnet.it> wrote:
Look at curses.
I was searching for something portable on multiple platforms.


Keyboard access is not portable. It is quite system-specific, even in C.
Curses doesn't work on Windows.


Sure it does. You can find curses implementations for Windows. However,
it depends on what you are planning to do. If all you want to do is wait
for one character and print it, it's not too hard to have separate schemes
for separate systems:

C:\Data\PyTools>python
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
import msvcrt
msvcrt.getch() '\x1b'


(I pressed "escape" after the second "enter".)
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Oct 11 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Rattanak Song | last post by:
Hi, I'm trying to build a database which can capture a still image from a digital camera or web cam and import to the database via an Object or something like that. Any help would be very...
0
by: David | last post by:
Hi, I have a MainForm with a Subform. On the Mainform are 3 Textboxes: Order Qty, Qty Shipped & Qty Outstanding Order Qty is a set figure for display purposes only Qty Shipped is a textbox...
6
by: SlasherStanley | last post by:
Hi Is there a way to capture CTRL - ALT - DELETE? I need to write a program that will stop people logging in during set periods. If this is not possible, Can I lock the Keyboard & Mouse?...
7
by: Bob Achgill | last post by:
When I use the code for KeyPress to capture pressing a certain key for processing on a form with no Text Box it works. But when I try the same code on my application that has text boxes it does...
3
by: Melson | last post by:
hi can anyone help me how can i capture ENTER keystroke when the cell in datagrid is in editing mode. I'm now creating a data entry form with primary key in header and details in datagrid. So...
2
by: Don | last post by:
It took me a while to find this code, so I decided to post it here for others who might also be looking for a way to trap tab key presses. You can extend a control and place this code in it to...
3
by: GS | last post by:
If I were to capture enter key on keyup event of an GUI object like comboBox box, How do I avoid killing ctrol-c, controlv, controlx, shift-insert, shiftdelete, contrl-insert
5
by: Sachyn | last post by:
I am developing two forms in FLASH for my client and it is extremely puzzling for me to get around the following facts: Requirement 1: to recognize signature when a form is signed in Flash and to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.