geany-plugins icon indicating copy to clipboard operation
geany-plugins copied to clipboard

geanynumberedbookmarks shortcuts do not work with numlock on

Open Davidy22 opened this issue 2 years ago • 13 comments

Installed and enabled geany-plugins on linux mint and enabled and tried the numbered bookmarks plugin, CTRL+shift+number and the respective CTRL+number appear to have no effect in geany 1.36. Can provide additional files on request.

Davidy22 avatar Jul 05 '21 08:07 Davidy22

WFM

09:30:53: Geany INFO		: Geany 1.38 (git >= b524a58e), en_AU.UTF-8
09:30:53: Geany INFO		: GTK 3.24.20, GLib 2.64.6
09:30:53: Geany INFO		: OS: Linux Mint 20 (ulyana)

elextr avatar Jul 05 '21 08:07 elextr

"Linux Mint" doesn't actually tell us anything, what version and what desktop? And check that the desktop isn't eating those keycodes for its purposes.

elextr avatar Jul 05 '21 08:07 elextr

oh, more detail: Mint 20.1, mate version. Geany built on or after 2020-03-22 Using GTK+ v3.24.20 and GLib v2.64.6 runtime libraries

Had tried mashing the shortcuts in other contexts to see if anything was bound to them, hadn't seen any effect. A config option to set and test the shortcuts could help maybe.

Davidy22 avatar Jul 05 '21 09:07 Davidy22

To see if those keycodes are available you can try setting something currently unbound in the standard keybindings preferences and see what you get, you can always unbind it again.

Note I get <primary><shift>exclam not <primary><shift>1 in the keybindings, but probably doesn't matter because it works for me.

elextr avatar Jul 05 '21 09:07 elextr

Also just a note that although I am using a git version, nothing has changed in numbered bookmarks since before 1.36. @Davidy22 This kind of indicates its in your system since it works here, just to check, please post the GTK/Glib versions from Help->Debug messages like I did, its not clear where you got the versions you mentioned, unless its actually what Geany prints it may not be what Geany is using since GTK2 is still present on Mint.

elextr avatar Jul 05 '21 09:07 elextr

I grabbed it from the about tab under help, but here's the debug messages version:

16:28:01: Geany INFO : Geany 1.36, en_US.UTF-8 16:28:01: Geany INFO : GTK 3.24.20, GLib 2.64.6

Didn't run into collision messages when binding those shortcuts in mint's general keyboard shortcuts utility, did check to see if it does give collision messages as well. I do also notice that I get SHIFT+CTRL+!, SHIFT+CTRL+@, SHIFT+CTRL+#, etc, and not the numbers. If there's a log to be produced I can get it.

Davidy22 avatar Jul 05 '21 10:07 Davidy22

Did you check with Geany keybindings prefs?

Also make sure that no other plugins are enabled, in fact restart Geany after you disable all other plugins.

elextr avatar Jul 05 '21 10:07 elextr

Alright, I tried toggling many things, and I finally found the problem, although I'm not sure why it would have an effect. Toggling off numlock was the solution. I swear I'm pressing the top bar number keys, not sure why numlock has an effect on this. Also to note, the numpad doesn't seem to work both with numlock on and off, I guess because shift+numpad key doesn't produce the top bar punctuation symbols and that's what the plugin's actually looking for? I'll look at the source some time, and edit the title of this ticket

Davidy22 avatar Jul 05 '21 11:07 Davidy22

Confirm numlock on stops it working.

Makes sense, having numlock on will probably set another modifier bit in the keyboard state. If the plugin uses raw keycode/modifier/state (rather than the GTK generated ones that keybindings uses, GTK knows numlock does not apply to non-keypad keys) then it might be disrupted by a numlock.

elextr avatar Jul 05 '21 11:07 elextr

Found the offending snippet, comparisons to an array of magic number keycodes starting line 1467

/* control+shift+number */
	if(ev->state==5) {
		/* could use hardware keycode instead of keyvals but if unable to get keyode then don't
		 * have logical default to fall back on
		*/
		for(i=0;i<10;i++) if((gint)(ev->keyval)==iShiftNumbers[i])
		{
			SetBookMark(doc, i);
			return TRUE;
		}

	}

can probably fix this, might be some amount of time later though

Davidy22 avatar Jul 05 '21 11:07 Davidy22

This plugin is marked as "maintained" but I note that the "maintainer" hasn't contributed anything since 2012, so I suspect it may in reality be abandoned.

elextr avatar Jul 05 '21 11:07 elextr

ping @WilliamFraser (probably, not listed in MAINTAINERS)

elextr avatar Jul 05 '21 11:07 elextr

Finally got the time to take a crack at it, printed some states through dialogs_show_msgbox and found the one for when numlock is on. If that commit does the job we can close this.

Davidy22 avatar Jul 21 '21 06:07 Davidy22