Pan by pixel count, if number prefix given

This commit is contained in:
Bert Münnich
2011-10-16 17:39:22 +02:00
parent dc727b8dce
commit 867940ea85
4 changed files with 25 additions and 10 deletions

6
main.c
View File

@ -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;
}