Skip to content
Snippets Groups Projects
Commit 3cb1e0d0 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

An initial attempt to normalize CTRL handling across modes.

This make curses mode try to map ctrl chars, but fall back to the
old behaviour of keeping the ctrl char.

In SDL, this is just a code cleanup.
parent 1b7bb63a
No related branches found
No related tags found
1 merge request!488Overhaul LZH code
Pipeline #7505 passed
......@@ -933,6 +933,7 @@ void curs_setcursortype(int type) {
int curs_getch(void)
{
wint_t ch;
wint_t newch;
#ifdef NCURSES_VERSION_MAJOR
MEVENT mevnt;
#endif
......@@ -1160,8 +1161,10 @@ int curs_getch(void)
default:
// Don't translate CTRL-x "keys"...
if (ch >= 32)
ch = cpchar_from_unicode_cpoint(getcodepage(), ch, 0);
newch = cpchar_from_unicode_cpoint(getcodepage(), ch, 0);
if (newch == 0 && ch < 32)
newch = ch;
ch = newch;
break;
}
}
......
......@@ -992,7 +992,6 @@ void sdl_video_event_thread(void *data)
sdl_add_key_uc(sdl_get_char_code(ev.key.keysym.sym, ev.key.keysym.mod), &cvstat);
}
else if (!isprint(ev.key.keysym.sym)) {
if (ev.key.keysym.sym < 128)
sdl_add_key_uc(ev.key.keysym.sym, &cvstat);
}
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment