From 1b46d8f35e59f9d5f7a651d8bc0635537410065c Mon Sep 17 00:00:00 2001 From: Adrian Lees Date: Mon, 2 May 2005 22:12:53 +0000 Subject: [project @ 2005-05-02 22:12:53 by adrianl] Fix Ctrl-Del and implement Home svn path=/import/netsurf/; revision=1710 --- riscos/window.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'riscos/window.c') diff --git a/riscos/window.c b/riscos/window.c index aab46b952..dd037cc5b 100644 --- a/riscos/window.c +++ b/riscos/window.c @@ -1646,6 +1646,8 @@ bool ro_gui_window_keypress(struct gui_window *g, int key, bool toolbar) wchar_t c = (wchar_t)key; static wchar_t wc = 0; /* buffer for UTF8 alphabet */ static int shift = 0; + bool ctrl_key = true; + /* Munge cursor keys into unused control chars */ /* We can't map onto 1->26 (reserved for ctrl+ That leaves 27->31 and 128->159 */ @@ -1655,7 +1657,10 @@ bool ro_gui_window_keypress(struct gui_window *g, int key, bool toolbar) case wimp_KEY_SHIFT | wimp_KEY_TAB: c = 11; break; /* cursor movement keys */ - case wimp_KEY_CONTROL | wimp_KEY_LEFT: c = KEY_LINE_START; break; + case wimp_KEY_HOME: + case wimp_KEY_CONTROL | wimp_KEY_LEFT: + c = KEY_LINE_START; break; + break; case wimp_KEY_END: if (os_version >= RISCOS5) c = KEY_LINE_END; @@ -1684,15 +1689,24 @@ bool ro_gui_window_keypress(struct gui_window *g, int key, bool toolbar) else if (os_version < RISCOS5) c = KEY_DELETE_LEFT; break; + + default: + ctrl_key = false; + break; } if (c < 256) { - if ((wchar_t)key > 256) - /* do nothing */; + if (ctrl_key) + /* do nothing, these are our control chars */; else if (alphabet != 111 /* UTF8 */ && - ucstable != NULL) + ucstable != NULL) { + /* defined in this alphabet? */ + if (ucstable[c] == -1) + return true; + /* read UCS4 value out of table */ - c = ucstable[c] == -1 ? 0xFFFD : ucstable[c]; + c = ucstable[c]; + } else if (alphabet == 111 /* UTF8 */) { if ((c & 0x80) == 0x00 || (c & 0xC0) == 0xC0) { -- cgit v1.2.3