[qwaq] Handle some keys in the editor

Doesn't work yet, though.
This commit is contained in:
Bill Currie 2020-03-24 13:38:20 +09:00
parent a75eeb6955
commit 995074269b
2 changed files with 12 additions and 1 deletions

View file

@ -103,7 +103,6 @@ arp_end (void)
event.what = qe_none; event.what = qe_none;
return self; return self;
} }
[objects handleEvent: event];
if (event.what == qe_key if (event.what == qe_key
&& (event.key.code == '\x18' || event.key.code == '\x11')) { && (event.key.code == '\x18' || event.key.code == '\x11')) {
event.what = qe_command; event.what = qe_command;
@ -114,6 +113,7 @@ arp_end (void)
|| event.message.command == qc_error)) { || event.message.command == qc_error)) {
endState = event.message.command; endState = event.message.command;
} }
[objects handleEvent: event];
return self; return self;
} }
@end @end

View file

@ -1,3 +1,4 @@
#include <QF/keys.h>
#include "color.h" #include "color.h"
#include "qwaq-editor.h" #include "qwaq-editor.h"
@ -54,7 +55,17 @@
[self scrollRight: 1]; [self scrollRight: 1];
} }
} }
} else if (event.what == qe_keydown) {
switch (event.key.code) {
case QFK_PAGEUP:
[self scrollUp: ylen];
break;
case QFK_PAGEDOWN:
[self scrollDown: ylen];
break;
} }
}
event.what = qe_none;
return self; return self;
} }