From 867940ea85495ac4e8e23efbb574fd9d86bccf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bert=20M=C3=BCnnich?= Date: Sun, 16 Oct 2011 17:39:22 +0200 Subject: Pan by pixel count, if number prefix given --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 1d73283..97dd2db 100644 --- a/main.c +++ b/main.c @@ -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; } -- cgit v1.2.3