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

MacOS system shortcut Cmd+Space does not work #47

Open
zebooka opened this issue Aug 24, 2023 · 12 comments
Open

MacOS system shortcut Cmd+Space does not work #47

zebooka opened this issue Aug 24, 2023 · 12 comments

Comments

@zebooka
Copy link

zebooka commented Aug 24, 2023

Even if I remove default Geany shortcut cmd+space (complete word), still MacOS system shortcut does not work. I use it for language switch (since MacOS Lion).

There is also second, may be connected problem — sometimes other shortcuts do not work completely, as if Geany thinks it is in wrong locale, although typing text shows it is in EN locale. Switching to another app (cmd+tab), pressing TWICE cmd+space to switch locale and returning to Geany fixes this issue. Also none of shortcuts work on non latin locale.

OS: MacOS Ventura 13.5, same on Monterey 12.6.7
Arch: M1 (arm), same on x86 macbook
Geany 1.38 installed from homebrew

@elextr
Copy link
Member

elextr commented Aug 24, 2023

The second part is not Mac specific and is also not fixable (for GTK3, maybe GTK4, not sure). Locales can change what character a particular physical key generates, especially in non-english locales where there are more than 26 letters in the alphabet, those extra characters must be generated somewhere on the keyboard to allow the locale language to be typed, so the keyboard key to character mapping changes. The example that found the issue was the Ctrl+C shortcut which in Cyrillic locale produces Ctrl+Б so it does not match the shortcut. GTK3 does not provide sufficient information to allow applications to decypher it. But GTK4 provides a hardware keycode as well as the character, that keycode may be locale independent, so more useful for shortcuts, but its not exactly copiously documented and GTK4 is a long way off for Geany.

On non-Mac systems with command lines Geany can be started with -c to specify a config directory, which is where the keyboard shortcuts are stored, so a user who swaps locales often may find it useful to have two separate configs, one for each locale. But I don't know if that works on Mac.

Thats does not address part one, a system shortcut seemingly being blocked by Geany, AFAICT so moving to Macos specific issues.

@elextr elextr transferred this issue from geany/geany Aug 24, 2023
@elextr
Copy link
Member

elextr commented Aug 24, 2023

My apologies to GTK4, it is documented https://docs.gtk.org/gdk4/keys.html, and should help sort out the locale vs shortcut issue, but only when Geany goes to GTK4.

@techee
Copy link
Member

techee commented Aug 24, 2023

Geany 1.38 installed from homebrew

Oh no, don't use that thing. Use the official binaries from

https://www.geany.org/download/releases/

I'd also suggest that you try the snapshot from

https://download.geany.org/snapshots/geany-1.38_osx_arm64-2.dmg

that fixes several things compared to the official release. Please let me know if it fixes the problem - I at least cannot reproduce it here.

@zebooka
Copy link
Author

zebooka commented Aug 24, 2023

https://download.geany.org/snapshots/geany-1.38_osx_arm64-2.dmg

Still does not work for language switch.

@zebooka
Copy link
Author

zebooka commented Aug 24, 2023

Geany 1.38 installed from homebrew

Oh no, don't use that thing. Use the official binaries from

It actually uses official releases:

$ brew info geany
==> geany: 1.38,4
https://www.geany.org/
/opt/homebrew/Caskroom/geany/1.38,4 (119B)
From: https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/g/geany.rb
==> Name
Geany
==> Description
Fast and lightweight IDE
==> Artifacts
Geany.app (App)
==> Analytics
install: 154 (30 days), 370 (90 days), 691 (365 days)
$ wget -O - -q https://github.com/Homebrew/homebrew-cask/blob/HEAD/Casks/g/geany.rb | jq | grep download
        "  url \"https://download.geany.org/geany-#{version.csv.first}_osx#{version.csv.second&.prepend(\"-\")}.dmg\"",
        "    url \"https://geany.org/download/releases/\"",

@techee
Copy link
Member

techee commented Aug 24, 2023

It's also possible that the installation from homebrew placed some GTK config files under ~/.config/gtk-3.0 which are now used also by the official binaries of Geany. Would you try to rename the gtk-3.0 to something else and restart Geany so it doesn't find the GTK config files when loaded?

@techee
Copy link
Member

techee commented Aug 24, 2023

It actually uses official releases:

Ah, OK, I think in the past they compiled it themselves.

But I can reproduce the problem now - normally I have Control and Command swapped so the keyboard behaves more like on PC but when I change it to defaults, I can reproduce the problem. I'll investigate.

@techee
Copy link
Member

techee commented Aug 24, 2023

I can reproduce the problem now

OK, well, but now Command-Space doesn't work anywhere on macOS for me (and I have checked is enabled for Input source switching and not assigned to anything else). Just to be sure, does Command+Space work in other applications on your Mac?

@zebooka
Copy link
Author

zebooka commented Aug 24, 2023

Surely. I use it for language switch (RU + EN). As I said, in order to switch language I have to Cmd+Tab to any other app, switch language and then Cmd+Tab again to Geany.

@techee
Copy link
Member

techee commented Aug 24, 2023

Alright, after resetting all macOS keybindings it started working again for me - but again, I can't reproduce it in Geany itself.

Maybe you could try renaming also Geany's config file at ~/.config/geany.conf to something else (when Geany is not open) to see if it's not something in your config file that causes the problem (Command+Space works for me also with default Geany config file). Also, what plugins are you using? Can you reproduce it with all plugins disabled?

@zebooka
Copy link
Author

zebooka commented Aug 24, 2023

I had removed all Geany configs. Still it does not work. The default key binding in Geany is "Complete word", so I had to remove it, but still system key binding does not work after that.
I use no plugins at all.

@techee
Copy link
Member

techee commented Aug 24, 2023

Yeah, but despite the default "Complete word" combination, macOS takes precedence in my case and triggers the keyboard switch.

You could also check if some other application doesn't do something strange with keyboard input (these applications typically need the Accessibility permission or the Input Monitoring permission so you could find them based on that). Otherwise I'm out of ideas.

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

No branches or pull requests

3 participants