Re: spec for accelerator string
- From: Peter Clifton <pcjc2 cam ac uk>
- To: gtk-app-devel-list gnome org
- Subject: Re: spec for accelerator string
- Date: Fri, 16 Feb 2007 13:08:08 +0000
On Fri, 2007-02-16 at 00:42 -0500, Dan McMahill wrote:
quoting from:
http://developer.gnome.org/doc/API/2.0/gtk/gtk-Keyboard-Accelerators.html#gtk-accelerator-parse
"Parses a string representing an accelerator. The format looks like
"<Control>a" or "<Shift><Alt>F1" or "<Release>z" (the last one is for
key release). The parser is fairly liberal and allows lower or upper
case, and also abbreviations such as "<Ctl>" and "<Ctrl>".
If the parse fails, accelerator_key and accelerator_mods will be set
to
0 (zero).
accelerator : string representing an accelerator
accelerator_key : return location for accelerator keyval
accelerator_mods : return location for accelerator modifier mask
"
Ok, so I give up. Where exactly is this format documented? For
example, I can't seem to get "F1", "F2", etc to work and I'm not sure
what to enter for the tab, space, page up/down, backspace, delete, etc
keys.
Also, is there a list of non-allowed keys for menu accelerators?
Hi Dan,
I've not spotted any docs anywhere for that either, and as per standard
GTK and GLib development requirements, keep a copy of the full
source-code to trawl through... I hope your request for better
documentation doesn't get shot down in flames like the last one.
If you grab the source tarball, and look under gdk/gtkkeynames.c, you
will find an array which defines all the key names.
The ones mentioned:
':' -> "colon"
'=' -> "equal"
"<shift>=" -> (I'd guess <shift>equal, <shift><equal> or similar?)
'/' -> "slash"
I've no idea which the square brackets are...
Looking at the character codes in Gnome's charmap, I think it is:
{ 0x00005b, "bracketleft" },
{ 0x00005d, "bracketright" },
Af first skim, my guess was that these were for round brackets though.
Evidentally these cause problems:
(pcb:4288): Gtk-WARNING **: Unable to parse accelerator ':' for
action
'MenuItem66'
(pcb:4288): Gtk-WARNING **: Unable to parse accelerator '<shift>='
for
action 'MenuItem133'
(pcb:4288): Gtk-WARNING **: Unable to parse accelerator '=' for
action
'MenuItem139'
(pcb:4288): Gtk-WARNING **: Unable to parse accelerator '/' for
action
'MenuItem187'
(pcb:4288): Gtk-WARNING **: Unable to parse accelerator '[' for
action
'MenuItem188'
(pcb:4288): Gtk-WARNING **: Unable to parse accelerator ']' for
action
'MenuItem189'
Thanks
-Dan
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]