473,498 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Standard names for common keyboard events

Hello,

I thought that I should ask here for comments on a blog entry that I
wrote some weeks ago. I am sure that other people have been thinking
about this, but I didn't yet find them.

The Python standard library unfortunately doesn't provide a module that
gives unique names to common keyboard events.

Even Tkinter had to write a complex parser to find out which keyboard
event the programmer actually means. The parser literally plays a
guessing game. If you want an event to happen when the user presses for
example the key combination Shift-F7, then you (the programmer) are
free to call this key S-F7, Sh-F7, Shift+F7,... and many more. Tkinter
will understand you! This is artificial intelligence! At run-time,
while the user is waiting! What a strange approach!

wxPython is also funny. Here is an excerpt from the wxMenu::Append()
documentation:

The item string for the normal menu items (not submenus or separators)
may include the accelerator which can be used to activate the menu item
from keyboard. The accelerator string follows the item label and is
separated from it by a TAB character ('\t'). Its general syntax is any
combination of "CTRL", "ALT" and "SHIFT" strings (case doesn't matter)
separated by either '-' or '+' characters and followed by the
accelerator itself. The accelerator may be any alphanumeric character,
any function key (from F1 to F12) or one of the special characters
listed in the table below (again, case doesn't matter):

wxPython has a lot of constants to name common key events. For example
the «page down» key is called wx.WXK_PAGEDOWN. But if you specify
PAGEDOWN in a wxMenu::Append() string, it won't work. Because for
wxMenu::Append() you must call this key PGDN.

I don't blame neither Tkinter nor wxPython, but these funny
observations show that a standard method to speak about keyboard events
would be useful.

I agree that the subject is not trivial, and that there are more than
one possible ways to implementat such a module. But as long as I don't
find a better solution I'll use my selfmade module:
http://svn.berlios.de/wsvn/lino/trun...ile&rev=0&sc=0

(Original entry is at http://lino.saffre-rumma.ee/news/356.html)

Luc

Jun 22 '06 #1
0 1912

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

Similar topics

25
3755
by: Magnus Lie Hetland | last post by:
Is there any interest in a (hypothetical) standard graph API (with 'graph' meaning a network, consisting of nodes and edges)? Yes, we have the standard ways of implementing graphs through (e.g.)...
2
3400
by: Patricio Stegmann | last post by:
Hello, I'm trying to capture all keyboard events from some different web page layouts: framesets with different stuff, like flash or whatever ! The problem I am getting is that only focused...
9
9703
by: Marek Mand | last post by:
How to use generated keyboard events? What I am trying here to do is in onkeyup event handler http://www.hot.ee/idaliiga/braggart/createEventTest.htm generate a (shift)TAB keydown so the...
0
2106
by: Veli-Pekka Tätilä | last post by:
Hi, My first post here. I've found some serious accessibility flaws in the Python 2.4 docs and wish they could be rectified over time. I'm very new to Python and initially contacted docs at python...
2
3138
by: wesmanjunk | last post by:
does anyone know how to generate keyboard events in another application? like public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); can be used for mouse...
104
5034
by: fieldfallow | last post by:
Hello all, Is there a function in the standard C library which returns a prime number which is also pseudo-random? Assuming there isn't, as it appears from the docs that I have, is there a...
24
2422
by: noridotjabi | last post by:
Why isn't there a Graphical User Interface standard? Think about it for a second. You may say, well evey systems API for GUIs is differnt, but do take into acound: every operating system requires...
0
1587
by: Gamey | last post by:
I have an application that NEEDS (don't ask) to handle additional mouse and keyboard processing during DoDragDrop. Normally, DoDragDrop kindly squashes all keyboard and mouse events. Alternate,...
13
8713
by: andypb123 | last post by:
Hello, The onchange event fires in IE6 in a SELECT element when scrolling through the list with the up and down arrows on the keyboard. In Firefox it only fires after you hit the enter key, which...
0
7162
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
7197
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...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
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
5456
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,...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.