change key constants
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-04-20 00:18:04 +09:00
commit d3eb93a30a
Signed by: nishi
GPG key ID: 27EF69B208EB9343
8 changed files with 73 additions and 73 deletions

View file

@ -92,7 +92,7 @@ static void key(MwWidget handle, int code) {
char* out;
if(str == NULL) str = "";
if(code == MwLLKeyBackSpace) {
if(code == MwKEY_BACKSPACE) {
if(t->cursor == 0) return;
out = malloc(strlen(str) + 1);
@ -105,17 +105,17 @@ static void key(MwWidget handle, int code) {
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
free(out);
} else if(code == MwLLKeyLeft) {
} else if(code == MwKEY_LEFT) {
if(t->cursor == 0) return;
t->cursor--;
} else if(code == MwLLKeyRight) {
} else if(code == MwKEY_RIGHT) {
if(t->cursor == MwUTF8Length(str)) return;
t->cursor++;
} else if(code == MwLLKeyEnter) {
} else if(code == MwKEY_ENTER) {
MwDispatchUserHandler(handle, MwNactivateHandler, NULL);
} else if(code == (MwLLControlMask | 'v')) {
} else if(code == (MwKEY_CONTROL_MASK | 'v')) {
MwLLGetClipboard(handle->lowlevel, MwCLIPBOARD_MAIN);
} else if(!(code & MwLLKeyMask)) {
} else if(!(code & MwKEY_MASK)) {
int incr = 0;
out = malloc(strlen(str) + 5 + 1);
incr += MwUTF8Copy(str, 0, out, 0, t->cursor);

View file

@ -75,7 +75,7 @@ static void key(MwWidget handle, int code) {
ok = 1;
} else if(code == '.' && strchr(str, (int)'.') == NULL) {
ok = 1;
} else if(code == MwLLKeyBackSpace || code == MwLLKeyLeft || code == MwLLKeyRight) {
} else if(code == MwKEY_BACKSPACE || code == MwKEY_LEFT || code == MwKEY_RIGHT) {
ok = 1;
}