masm11 / emacs

Mirror of GNU Emacs
http://www.gnu.org/software/emacs/
GNU General Public License v3.0
199 stars 14 forks source link

Shift-space not registering #107

Open titaniumbones opened 2 years ago

titaniumbones commented 2 years ago

Hi, first of all I'm not sure you guys are still taking bug reports here. I am using a recent emacs git with pgtk and gcc enabled. (the Arch Linux package).

For some time now I've realized that S-Space is being interpreted as just a plain old Space. For instance, C-h k S-Space will give me the help for SPC, no matter what mode I'm in, and (read-key) followed by shift and then space will give me keycode 32, the same code I get when I don't press the spacebar.

I can't figure out what the issue is. As far as I can tell, there is nothing relevant in my config, and emacs -Q shows the same issue. Other gtk programs can register the difference between space and shift-space.

thanks for your help as always!

masm11 commented 2 years ago

If you don't need input methods, try:

(pgtk-use-im-context nil)

Other gtk programs can register the difference between space and shift-space.

Please tell me what those programs are.

titaniumbones commented 2 years ago

Hi @masm11 , I am just returning to this issue after some time, and hadn't realized I owed you a comment -- I had mixed this conversation up with another one on Reddit: https://www.reddit.com/r/emacs/comments/osscfd/pgtk_emacswaylandgnome_no_shiftspace/

To respond properly:

I should also say that I'm running an up to date Arch Linux, Gnome 41.3 and recent versions of wayland & emacs git built form master using pgtk and native-comp.

It does seem that the keystroke is somehow accessible in some circumstances. I did just now try to use wev to inspect the keypress events, but it is not currently running on y system due to some kind of library compatibility issue (cf this comment: https://aur.archlinux.org/packages/wev/#comment-836682)

Thank you for all your work on this huge feature.

masm11 commented 2 years ago

@titaniumbones Thanks for a lot of information.

I tried some of the noticed apps: WhatsApp Nativefier, Signal desktop, and Firefox.

I could do back-scroll with shift-space unless a text area is focused. I couldn't if a text area is focused.

I think that those apps switch disable/enable of the input method. If a text area is focused, the input method is enabled and shift-space doesn't work. If a non text area is focused, the input method is disabled and shift-space works as back-scroll.

Emacs doesn't have such a mode.

I'll take a look at the firefox source code to see if my think is correct.

titaniumbones commented 2 years ago

Emacs doesn't have such a mode.

ah, right, interesting. hmm. two thoughts so far:

many thanks.

masm11 commented 2 years ago

Would it be possible to use a buffer-local variable to somehow affect the relationship of emacs to input methods?

OK, I'll try, though I don't know whether I can implement it.

masm11 commented 2 years ago

Try this patch!

pgtk-im-per-buffer.diff.gz

EDIT: I changed pgtk-use-im-context from a function to a buffer-local variable.

titaniumbones commented 2 years ago

I missed this 2 weeks ago! sorry for the delay responding.

I will figure out how to apply this patch and recompile! Thanks so much for the help. Really looking forward to trying this.