Re: Recovering keys from key events
- From: edreamleo@xxxxxxxxx
- Date: Mon, 24 Dec 2007 07:29:04 -0800 (PST)
On Dec 23, 3:17 pm, Kevin Kenny <kenn...@xxxxxxx> wrote:
But remember that many key events come from composed sequences and
the like.
Thanks for this discussion. It's good to get confirmation from
someone who knows. Indeed, given the complexities involved (e.g.
sticky keys, etc.) it's kinda surprising that key handling works at
all :-)
Generally speaking, in an application, you have some fixed set
of key bindings that you want to handle: Ctrl-s might mean 'save',
for instance, or Alt-f might mean 'post the "File" menu'. You
bind the key events that correspond to these actions, and let the
other bindings flow through. If your application is a complicated
one with many text and entry widgets, you most likely will bind
the keys to a single bindtag, and then put that bindtag on multiple
widgets. What is it that you're doing that requires you to
distinguish the key state in a generic fashion? Are you trying
to subvert your platform's input methods, or something?
This is exactly how Leo works. No, I'm not trying to subvert the
platform's input method. Instead, Leo sends all keystrokes to a
'master key handler'. To do this, Leo binds all 'bound' keys to key-
specific callbacks that in turn call the master key handler with an
argument that tells what the original binding was. This requires
making a unique callback for every binding. It certainly works, but I
was hoping there was a way of having Tk do the work for me :-) Oh
well...
Edward
.
- References:
- Recovering keys from key events
- From: edreamleo
- Re: Recovering keys from key events
- From: Kevin Kenny
- Re: Recovering keys from key events
- From: edreamleo
- Re: Recovering keys from key events
- From: Kevin Kenny
- Recovering keys from key events
- Prev by Date: ANNOUNCE: eTcl 1.0-rc24 - Tcl/Tk 8.5.0 inside
- Next by Date: Re: ttk::treeview to mimic iTunes source list?
- Previous by thread: Re: Recovering keys from key events
- Next by thread: Where is the expand {*} syntax in the man pages?
- Index(es):
Relevant Pages
|