unmodified accelerators and _gtk_window_activate_key()



hi folks.

currently, processing accelerator and mnemonic keys always has precedence over
key processing done by the focus widget.
that means, while typeing in a GtkEntry, one can use <alt>+f to popup the
_File menu, since <alt>+f is being consumed as an accelerator before possibly
being send to the entry.
in case of unmodified (simple letter) accelerators though [#1], this behaviour
can be quite irritating.
i.e. menu items which use ordinary letters and numbers as accelerators without
modifiers (ctrl or alt), are also being activated while typeing in a GtkEntry.
in almost all cases, users will want unmodified letters/numbers to be available
for entering text in an entry though.

in order to make the latter work, i suggest to:
a) give precedence to the focus widget when processing accelerators without
   modifiers (except shift) in gtk_window_key_press_event().
b) allow user applications to implement their own precedence schemes by
   overriding and changing the implementation of gtk_window_key_press_event().
   this requires making _gtk_window_activate_key() public, which is currently
   used in the implementation of gtk_window_key_press_event().

while i don't expect users to make much use of (b) if (a) is in place, having
it already would have allowed to try out the proposed scheme by customizing
existing user applications first.


#1) in a GUI which requires lots of graphical interactions (moving things
    around, pointing at items, drawing/dragging) with only occasional text
    modification, single letter or number accelerators can be quite convenient.
    example applications using them are gimp or beast.

---
ciaoTJ




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]