From f9b12bd17c7f263670e16d8ebd60c06dee8dba73 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Wed, 9 Nov 2011 12:51:37 -0600 Subject: [PATCH] fix some sites that screw with keyboard focus This changes the behavior buffercommands by returning USED vs PASSTHROUGH on non ascii characters. This seems to work but I don't know if this affects non-US keyboards in any way. Please test this a lot! --- xxxterm.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xxxterm.c b/xxxterm.c index 453f6cb..7659877 100644 --- a/xxxterm.c +++ b/xxxterm.c @@ -2548,8 +2548,8 @@ focus_input(struct tab *t) WebKitDOMNodeList *fl = NULL, *ifl = NULL; int i, fl_count, ifl_count, rv = 0; - WebKitDOMHTMLFrameElement *frame; - WebKitDOMHTMLIFrameElement *iframe; + WebKitDOMHTMLFrameElement *frame; + WebKitDOMHTMLIFrameElement *iframe; /* * Here is what we are doing: @@ -4885,8 +4885,16 @@ buffercmd_addkey(struct tab *t, guint keyval) } /* key with modifier or non-ascii character */ - if (!isascii(keyval)) - return (XT_CB_PASSTHROUGH); + if (!isascii(keyval)) { + /* + * XXX this looks wrong but fixes some sites like + * http://www.seslisozluk.com/ + * that eat a shift or ctrl and end putting default focus in js + * instead of ignoring the keystroke + * so instead of return (XT_CB_PASSTHROUGH); eat the key + */ + return (XT_CB_HANDLED); + } DNPRINTF(XT_D_BUFFERCMD, "buffercmd_addkey: adding key \"%c\" " "to buffer \"%s\"\n", keyval, bcmd); -- 2.11.4.GIT