tags 339131 + patch thanks Patch attached. There is also the issue of overlapping key bindings; however, I do not believe there's any satisfactory way of resolving this. You should avoid picking keybindings that will conflict with each other in the same context.
Thanks,
Daniel
Mon Nov 14 20:59:16 PST 2005 Daniel Burrows <[EMAIL PROTECTED]>
* Canonicalize keybinding names internally to make them case-insensitive.
(half of fix for #339131)
Mon Nov 14 20:40:49 PST 2005 Daniel Burrows <[EMAIL PROTECTED]>
* Parse single-character keybindings instead of failing unconditionally.
(half of fix for #339131)
diff -rN -udp old-head/src/vscreen/config/keybindings.cc
new-head/src/vscreen/config/keybindings.cc
--- old-head/src/vscreen/config/keybindings.cc 2005-11-14 21:04:18.000000000
-0800
+++ new-head/src/vscreen/config/keybindings.cc 2005-11-14 20:43:34.000000000
-0800
@@ -34,6 +34,7 @@
#include <ctype.h>
+#include <algorithm>
#include <map>
using namespace std;
@@ -256,13 +257,30 @@ void init_key_tables()
rev_keynames[key(KEY_SUNDO, true)]=L"undo";
}
+// Needed because C++ doesn't understand that &toupper
+// can be used with the signature (char -> char).
+struct toupper_struct
+{
+public:
+ char operator()(char c) const
+ {
+ return toupper(c);
+ }
+};
+
void keybindings::set(string tag, keybinding strokes)
{
+ transform(tag.begin(), tag.end(),
+ tag.begin(), toupper_struct());
+
keymap[tag]=strokes;
}
bool keybindings::key_matches(const key &k, string tag)
{
+ transform(tag.begin(), tag.end(),
+ tag.begin(), toupper_struct());
+
hash_map<string, keybinding>::iterator found=keymap.find(tag);
if(found==keymap.end())
return parent?parent->key_matches(k, tag):false;
@@ -342,7 +360,8 @@ key parse_key(wstring keystr)
return KEY_CTRL(ch);
if(afound)
return KEY_ALT(ch);
- return rval;
+
+ return key(ch, false);
}
else
{
signature.asc
Description: Digital signature

