diff options
author | Bert Münnich <ber.t@gmx.com> | 2011-10-16 17:39:22 +0200 |
---|---|---|
committer | Bert Münnich <ber.t@gmx.com> | 2011-10-16 17:39:22 +0200 |
commit | 867940ea85495ac4e8e23efbb574fd9d86bccf42 (patch) | |
tree | 6dc435cef2386dc37265d6dde787c1cf35f47e4f /main.c | |
parent | dc727b8dce89811d755ed03d11688b13a42e794a (diff) |
Pan by pixel count, if number prefix given
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -337,9 +337,11 @@ void on_keypress(XKeyEvent *kev) { XLookupString(kev, &key, 1, &ksym, NULL); - if (key >= '0' && key <= '9' && (kev->state & ControlMask) == 0) { + if ((ksym == XK_Escape || (key >= '0' && key <= '9')) && + (kev->state & ControlMask) == 0) + { /* number prefix for commands */ - prefix = prefix * 10 + (int) (key - '0'); + prefix = ksym == XK_Escape ? 0 : prefix * 10 + (int) (key - '0'); return; } |