msg59720 - (view) |
Author: Nashev (Nashev) |
Date: 2008-01-11 16:58 |
In most platform-depended applications hot keys are working by the
specified keys on a keyboard, independent of a current keyboard layout.
Not by the specified char.
Some application menus is displaying keyboard shortcut localized to main
layout for current language. But still working in any layout of keyboard
currently selected.
IDLE is not. :(
Can any one do something with it unpleasant situation?
|
msg59722 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2008-01-11 17:26 |
Not being familiar with localized keyboards, I don't understand your
question. Can you provide some screen dumps of what you see and explain
what you expected to see?
PS. What OS?
|
msg59724 - (view) |
Author: Christian Heimes (christian.heimes) *  |
Date: 2008-01-11 17:31 |
I *think* Nashev is talking about assigning hot keys by scan code rather
than by character code.
E.g. on a German keyboard the 'z' and 'y' are switched and the 'z' key
is left to the 't' key. If a program assigns a hot key to 'z' by
character code than the user has to press the 'z' key which is a
different key on the German keyboard. However if a hot key is assigned
by scan code (not sure if it's the right term) than the hot key is still
assigned the physical key in the lower left corner.
|
msg59726 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2008-01-11 17:34 |
So what's a hot key? Now I'm really confused. I don't recall anything
using scan codes in IDLE, at least not for the memory shortcuts etc.
|
msg59729 - (view) |
Author: Georg Brandl (georg.brandl) *  |
Date: 2008-01-11 17:45 |
Christian Heimes schrieb:
> Christian Heimes added the comment:
>
> I *think* Nashev is talking about assigning hot keys by scan code rather
> than by character code.
>
> E.g. on a German keyboard the 'z' and 'y' are switched and the 'z' key
> is left to the 't' key. If a program assigns a hot key to 'z' by
> character code than the user has to press the 'z' key which is a
> different key on the German keyboard. However if a hot key is assigned
> by scan code (not sure if it's the right term) than the hot key is still
> assigned the physical key in the lower left corner.
On which platforms do hotkeys have that behavior? I've never seen it.
|
msg59731 - (view) |
Author: Christian Heimes (christian.heimes) *  |
Date: 2008-01-11 17:50 |
> On which platforms do hotkeys have that behavior? I've never seen it.
Some computer games define hot keys by scan code rather than by
character. I'm not sure if it's a good idea for IDLE but for games it
often makes sense.
|
msg59736 - (view) |
Author: Nashev (Nashev) |
Date: 2008-01-11 19:12 |
WOW, so active discussion!
OS - Windows & Mac OS X, both
Programs - most system and many others.
Keyboard layouts - I mean mostly non latin (see
http://en.wikipedia.org/wiki/Keyboard_layout#Keyboard_layouts_for_non-Roman_alphabetic_scripts)
In case of russian keyboard layout i have in place of latin char 'x'
russian letter 'ч', and want to call <<Cut>> command by pressing this
hot key when keyboard really sent to application some like Ctrl+Ч too
In Windows we have messages WM_KeyDown and WM_KeyUp that send always key
index, stored as constants (defined in windows.h or messages.h) like
wk_return, wk_F1, etc. For letter keys, messages come with codes that
always equal to index of similar uppercase latin chars. for example,
first key code in middle row equal ord ('A') = 65. And in context of
russian layout this code translated to Cyrillic letter Ф and sent to
window with next message wm_char. Hot key handling based on WM_KeyDown,
nor WM_Char
P.S.: Samples of localized showing of the hot keys in menu based on
interface language or current keyboard layout I can't find right now,
but i remember that I have this experience. This is feature not
necessary, because reading some like Ctrl+Ч near menu Cut is really
frustrating.
|
msg59742 - (view) |
Author: Guido van Rossum (gvanrossum) *  |
Date: 2008-01-11 19:58 |
IDLE is written using Tkinter, not native Windows UI programming APIs, I
don't know if the scan code is available in the keyboard events.
If you want something to happen on this, I suggest you try to create a
patch to IDLE yourself -- it's unlikely that any of the current
developers has the time to figure this out, given that we don't have
Russian keyboards nor Russian versions of Windows or Mac.
|
msg59746 - (view) |
Author: Raymond Hettinger (rhettinger) *  |
Date: 2008-01-11 20:40 |
IDLE lets you configure your own mappings without doing any programming.
From the menu, pick Options, Configure Idle and goto the Keys tab.
|
msg59749 - (view) |
Author: Nashev (Nashev) |
Date: 2008-01-11 21:06 |
Guido, I think now it is must be suggestion to TK team, in they's issue
tracker...
Raymond, I know I can make try localized hot key mapping for my keyboard
layout for my self, but i think the best way is - help to make our
public libraries better for all. But any way, Thank You for try solve my
local problem.
|
msg62215 - (view) |
Author: Tal Einat (taleinat) *  |
Date: 2008-02-09 00:53 |
(sorry to be joining in late, but I just happened upon this...)
Nashev, if you configured your IDLE's keys to fit a Russian keyboard
layout, then you could post your config-keys.cfg file (from your .idlerc
directory) on the internet for others to enjoy. (this is the file where
user-configured key bindings are saved)
IMHO, specifically in the case of IDLE, binding to scan codes instead of
characters would be harmful, since it would be harder for users not
familiar with scan codes to understand and tweak.
|
msg67117 - (view) |
Author: Nashev (Nashev) |
Date: 2008-05-20 08:34 |
https://bugzilla.mozilla.org/show_bug.cgi?id=69230 - it is the same
bugreport for other program. It is contain many comments and explains :)
|
msg86386 - (view) |
Author: Guilherme Polo (gpolo) *  |
Date: 2009-04-23 23:46 |
That bug report is talking about gtk and modifiers affecting bindings
(in the first comments at least), or maybe it even talks about your
problem but it is so long that I would ask to include the relevant parts
here.
Nevertheless, after reading your comments I came to the conclusion that
doing what you want is very unlikely to happen. To bind something in Tk
you have to a specify a string like "<Control-x>", but to do what you
want, it would have to change to:
import Tkinter
def test(event):
if event.keysym_num == ord('x') and event.state & 4:
print "Ctrl-x!"
root = Tkinter.Tk()
root.bind('<KeyPress>', test)
root.mainloop()
Maybe you can test this and verify if it works like you wanted. But I
really don't see IDLE changing to work like that.
|
msg116864 - (view) |
Author: Mark Lawrence (BreamoreBoy) * |
Date: 2010-09-19 11:23 |
From msg86386 "Nevertheless, after reading your comments I came to the conclusion that doing what you want is very unlikely to happen." so closing.
|
msg117259 - (view) |
Author: R. David Murray (r.david.murray) *  |
Date: 2010-09-24 03:07 |
it does seem that the consensus is that this is not a generally desirable feature.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:56:29 | admin | set | github: 46127 |
2015-11-15 09:01:39 | THRlWiTi | set | nosy:
+ THRlWiTi
|
2010-09-24 03:07:25 | r.david.murray | set | status: open -> closed nosy:
+ r.david.murray, - BreamoreBoy messages:
+ msg117259
resolution: rejected stage: resolved |
2010-09-19 11:23:26 | BreamoreBoy | set | nosy:
+ BreamoreBoy messages:
+ msg116864
|
2009-04-23 23:46:49 | gpolo | set | versions:
- Python 2.5 nosy:
+ gpolo
messages:
+ msg86386
components:
+ IDLE, - Tkinter type: enhancement |
2008-05-20 08:34:52 | Nashev | set | messages:
+ msg67117 |
2008-02-09 00:53:35 | taleinat | set | nosy:
+ taleinat messages:
+ msg62215 |
2008-01-23 22:30:44 | kbk | set | components:
- IDLE |
2008-01-14 00:28:35 | kbk | set | nosy:
+ kbk |
2008-01-11 21:06:28 | Nashev | set | messages:
+ msg59749 |
2008-01-11 20:40:58 | rhettinger | set | nosy:
+ rhettinger messages:
+ msg59746 |
2008-01-11 19:58:44 | gvanrossum | set | messages:
+ msg59742 |
2008-01-11 19:12:25 | Nashev | set | messages:
+ msg59736 |
2008-01-11 17:50:51 | christian.heimes | set | messages:
+ msg59731 |
2008-01-11 17:45:42 | georg.brandl | set | nosy:
+ georg.brandl messages:
+ msg59729 |
2008-01-11 17:34:36 | gvanrossum | set | messages:
+ msg59726 |
2008-01-11 17:31:16 | christian.heimes | set | nosy:
+ christian.heimes messages:
+ msg59724 |
2008-01-11 17:26:20 | gvanrossum | set | priority: low nosy:
+ gvanrossum messages:
+ msg59722 |
2008-01-11 16:58:17 | Nashev | create | |