473,287 Members | 1,800 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,287 software developers and data experts.

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 1902

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

Similar topics

25
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
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
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
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
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
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
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
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
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...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.