really_add_keybinding: Display the canonical name of the keystroke.
commit93ef5e02f56768a296fdf46400a8ab181a1a6a1f
authorKalle Olavi Niemitalo <kon@iki.fi>
Sun, 13 Aug 2006 11:04:17 +0000 (13 14:04 +0300)
committerKalle Olavi Niemitalo <Kalle@Astalo.kon.iki.fi>
Sun, 13 Aug 2006 11:04:17 +0000 (13 14:04 +0300)
treead7e80b5e3215740ac47162d1da78c7c71794024
parent921f12926fd91b0744ea015529bfc6e37c90936c
really_add_keybinding: Display the canonical name of the keystroke.

Before really_add_keybinding() is called, check_keystroke() calls
parse_keystroke(), which converts the modifier prefix to canonical
form: for example, "alt+f9" becomes "Alt-f9".  This commit makes
really_add_keybinding() normally ignore that string and generate a
brand new one, e.g. "Alt-F9" (note the upper-case F), for its
"Keystroke already used" warning.  Likewise, " " turns to "Space".

After this commit, it should be possible to change parse_keystroke()
to never write back into its input string.

If really_add_keybinding() cannot generate the string for some reason
(out of memory?), then it will use whatever parse_keystroke() has left
in the buffer.  The alternatives would be to omit the keystroke name
from the warning or to reject the keybinding entirely; it isn't clear
what the best solution is here, but the one I implemented is closest
to the previous behaviour.
src/config/dialogs.c