Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geanynumberedbookmarks shortcuts do not work with numlock on #1089

Open
Davidy22 opened this issue Jul 5, 2021 · 13 comments
Open

geanynumberedbookmarks shortcuts do not work with numlock on #1089

Davidy22 opened this issue Jul 5, 2021 · 13 comments

Comments

@Davidy22
Copy link

Davidy22 commented Jul 5, 2021

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.

@elextr
Copy link
Member

elextr commented Jul 5, 2021

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
Copy link
Member

elextr commented Jul 5, 2021

"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.

@Davidy22
Copy link
Author

Davidy22 commented Jul 5, 2021

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.

@elextr
Copy link
Member

elextr commented Jul 5, 2021

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
Copy link
Member

elextr commented Jul 5, 2021

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.

@Davidy22
Copy link
Author

Davidy22 commented Jul 5, 2021

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.

@elextr
Copy link
Member

elextr commented Jul 5, 2021

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.

@Davidy22
Copy link
Author

Davidy22 commented Jul 5, 2021

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 Davidy22 changed the title geanynumberedbookmarks shortcuts dead on geany 1.36 geanynumberedbookmarks shortcuts do not work with numlock on Jul 5, 2021
@elextr
Copy link
Member

elextr commented Jul 5, 2021

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.

@Davidy22
Copy link
Author

Davidy22 commented Jul 5, 2021

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

@elextr
Copy link
Member

elextr commented Jul 5, 2021

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
Copy link
Member

elextr commented Jul 5, 2021

ping @WilliamFraser (probably, not listed in MAINTAINERS)

@Davidy22
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants