@b4n commented on this pull request.
This will accept more modifiers than just <kbd>Control</kbd> and
<kbd>Shift</kbd>, it just checks those are active, not that no other are (e.g.
<kbd>Meta</kbd>, <kbd>Super</kbd> or others).
I believe the "right" fix for not getting confused by numlock is this:
```diff
diff --git a/geanynumberedbookmarks/src/geanynumberedbookmarks.c
b/geanynumberedbookmarks/src/geanynumberedbookmarks.c
index 206c460c..9f8324b9 100644
--- a/geanynumberedbookmarks/src/geanynumberedbookmarks.c
+++ b/geanynumberedbookmarks/src/geanynumberedbookmarks.c
@@ -1482,6 +1482,7 @@ static gboolean Key_Released_CallBack(GtkWidget *widget,
GdkEventKey *ev, gpoint
{
GeanyDocument *doc;
gint i;
+ GdkModifierType state = keybindings_get_modifiers(ev->state);
doc=document_get_current();
if(doc==NULL)
@@ -1491,7 +1492,7 @@ static gboolean Key_Released_CallBack(GtkWidget *widget,
GdkEventKey *ev, gpoint
return FALSE;
/* control and number pressed */
- if(ev->state==4)
+ if(state == GDK_CONTROL_MASK)
{
i=((gint)(ev->keyval))-'0';
if(i<0 || i>9)
@@ -1501,7 +1502,7 @@ static gboolean Key_Released_CallBack(GtkWidget *widget,
GdkEventKey *ev, gpoint
return TRUE;
}
/* control+shift+number */
- if(ev->state==5) {
+ if(state == (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) {
/* could use hardware keycode instead of keyvals but if unable
to get keyode then don't
* have logical default to fall back on
*/
```
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/pull/1093#pullrequestreview-2961714823
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/pull/1093/review/[email protected]>