Revisit inline find bindings to support the numpad '/' key
This commit is contained in:
parent
dced22f179
commit
1dee538e41
1 changed files with 6 additions and 4 deletions
|
@ -26,6 +26,7 @@
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <glib/gprintf.h>
|
#include <glib/gprintf.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
#include <gdk/gdkkeysyms.h>
|
||||||
#include <webkit/webkit.h>
|
#include <webkit/webkit.h>
|
||||||
|
|
||||||
/* This is unstable API, so we need to declare it */
|
/* This is unstable API, so we need to declare it */
|
||||||
|
@ -1016,15 +1017,16 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
|
||||||
MidoriView* view)
|
MidoriView* view)
|
||||||
{
|
{
|
||||||
guint character = gdk_unicode_to_keyval (event->keyval);
|
guint character = gdk_unicode_to_keyval (event->keyval);
|
||||||
/* Skip control characters */
|
|
||||||
if (character == (event->keyval | 0x01000000))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (character == '.' || character == '/')
|
if (event->keyval == '.' || event->keyval == '/' || event->keyval == GDK_KP_Divide)
|
||||||
character = '\0';
|
character = '\0';
|
||||||
else if (!view->find_while_typing)
|
else if (!view->find_while_typing)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* Skip control characters */
|
||||||
|
if (character == (event->keyval | 0x01000000))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (!webkit_web_view_can_cut_clipboard (web_view)
|
if (!webkit_web_view_can_cut_clipboard (web_view)
|
||||||
&& !webkit_web_view_can_paste_clipboard (web_view))
|
&& !webkit_web_view_can_paste_clipboard (web_view))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue