Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

problems with gDocs #6

Closed
dkbast opened this issue Jan 25, 2018 · 38 comments
Closed

problems with gDocs #6

dkbast opened this issue Jan 25, 2018 · 38 comments

Comments

@dkbast
Copy link

dkbast commented Jan 25, 2018

Hi,
I'm having trouble using docs.google.com, as for some reason it is impossible to type slash / or questionmark ?. Doing so by pressing [CAPS-LOCK] and [S] or [H] results in opening the help-menu search window. Im using Karabiner-Elements with the provided neo config file without any further modifications.
BTW: Thanks for providing your layout file in the first place :)
P.S.: Would you mind adding a little bit of documentation on where your layout differs from the "neo-layout.org" file in the readme?

@jgosmann
Copy link
Owner

Which browser are you using? It works for me in Firefox.

Would you mind adding a little bit of documentation on where your layout differs from the "neo-layout.org" file in the readme?

I should indeed do that. For now, you can take a look at the commit history. It is still quite short and gives you an impression of the changes.

@dkbast
Copy link
Author

dkbast commented Jan 25, 2018

I just tried Firefox, and its working there! Thanks :) I would still like to stick with Chrome though. I believe the difference lies in "option key + /" on Chrome and "ctrl + ' " on Firefox....

Already took a look at the commit history :)

jgosmann added a commit that referenced this issue Jan 28, 2018
@jgosmann
Copy link
Owner

I can reproduce the problem in Chrome, but unfortunately I see no way to fix it.

@dkbast
Copy link
Author

dkbast commented Mar 8, 2018

So I finally did some digging and was able to find the underlying problem:
To produce "?" which is on mapIndex 4 the option and the command key have to be pressed


To produce "/" which is on mapIndex "6" its almost the same story:


So to fix this it would be necessary to replace "anyOption" with a different key and to do the same in the karabiner elements complex modification "Neo mod3 and mod4 keys (apple)".

Could you point me to a key I could use for this?

@leezu
Copy link

leezu commented May 30, 2018

A similar issue arises with http://codemirror.net/ , which is used for input in Jupyter notebook. In this case typing = is impossible when using Firefox, however it does work on Chrome.

Do you face the same issue? There is a test input field at http://codemirror.net/ , so you can give it a quick try.

Would this be an issue that needs to be fixed in the respective Browsers, or do you have any other ideas how to fix this?

@jgosmann
Copy link
Owner

In this case typing = is impossible when using Firefox, however it does work on Chrome.

For that reason I use Chrome for Jupyter notebooks. Unfortunately, I believe that there is no way to fix this on the level of the keyboard layout (except rearranging the layout). The comments on codemirror/codemirror5#4066 make me believe that is either a browser bug of erroneously triggering an Alt+F event (though this depends on the exact semantics when those events are supposed to be triggered) or a bug in CodeMirror. Though as pointed out, they may not be able to do much about it either as they cannot tell whether the Alt+F event is intended to produce a printable character with the current keyboard layout.

@sschmidTU
Copy link

sschmidTU commented Jan 25, 2019

I also noticed that typing / and ? in google docs opens menus instead.
For / there's a workaround: Use M4+9, it's an alternate for / (M3+S).

Unfortunately, there's no alternate binding for ?.
I guess quickly change keyboard layout to QWERTY (lame),
or copy paste it, if necessary from Terminal:
printf '\77' | pbcopy
(pbcopy copies to clipboard. then you add an alias pq='printf "\77" | pbcopy' to your ~/.bash_profile for convenience...)
;)

ps: @jgosmann I just noticed it's you who did this Mac improvement for Neo2, nice! I started using Macs recently for work, it's good to have my favourite layout.
Would be even nicer if Neo2 was a standard layout on Mac as with Linux, immediately available on any distribution (!).

@PascalCremer
Copy link

@jgosmann First of all thank you for providing this improved layout!

I recently switched from Linux to Mac and was wandering if there are any news regarding improved behavior in google docs. I also have problems typing '?' inside gmail to see a list of hotkeys, or to delete E-Mails with '#' which both require M3.

I'd also be willing to spend some time improving the layout if you can point me to where I would have to start.

@jgosmann
Copy link
Owner

jgosmann commented Jun 9, 2019

The problem here isn't so much implementing modifications to the layout, but finding a solution to the problem. I might even argue that this Google's fault for putting using a hot key with a pure alt/option modifier which is a key that is commonly used (even in other keyboard layouts) to produce a number of special symbols with a third layer. So the Neo2 layout just defines Option+h to be ?, but Google Docs sees that a ? was pressed while Option was active. Only way to get around that is to have Option+h produce ? without Option being reported as pressed anymore (while it still is physically). There might be a super hacky way to achieve that with a complex Karabiner-elements rule that needs to trigger when Option+h is pressed and do the following:

  1. Make sure Option is treated as unpressed (this might be the default, I haven't written such rules in a while).
  2. Trigger the "Ebene 4 und 6" dead key on the layout.
  3. Trigger a key that has been assigned to produce ? in the given dead key state in the keyboard layout.
  4. Restore Option pressed state (if this doesn't happen automatically)

Note while this solution might solve the problem in Google Docs it might lead to other problems with this key in shortcuts. It will likely not be possible to use ? in any shortcuts anymore because it does not map to a single keystroke anymore.

@PascalCremer
Copy link

Thanks for the details! I see your point why the outlined implementation might not be optimal.

I don't know any implementation details but is caps lock simply mapped to 'option'? I didn't realize that until you mentioned that ? in Neo2 is Option+h, while I'm usually getting this by caps lock + h. Would it be possible to get the 3rd layer with caps lock without mapping to Option, thereby not confusing google docs?

@jgosmann
Copy link
Owner

Yes, caps lock is simply mapped to 'option'. To achieve the the third layer in a different way I see to potential options:

  1. Use a different combination of modifier keys to activate layer 3 and map caps lock (as well as the right mod3 key) to this combination. But (in part because Neo2 already has 6 layers) I don't see any combination of modifier keys that could be used without introducing other problems (e.g. using command would mess with a different set of shortcuts).
  2. Implement the whole layer 3 with the dead key approach which seems worse than doing it just for ? and maybe a few other problematic characters.

@PascalCremer
Copy link

PascalCremer commented Jun 10, 2019

So you're saying that to activate different layers, you need to use a combination of modifier keys, i.e. control, option, command, and shift? Is this a limitation of Karabiner-Elements?

@jgosmann
Copy link
Owner

This is a limitation of MacOS keyboard layouts. The layers are defined within the modifierMap tag with keyMapSelect tags. Each of these tags contains a modifier tag that declares the modifier keys to activate the layer and this tag only supports the common modifier keys. Even though this mentions caps lock as modifier key, this actually corresponds to the caps lock activated state (i.e. after pressing both shift keys in Neo2), not having the physical caps lock key pressed.

@PascalCremer
Copy link

Oh I see, that's quite annoying. Personally, I have never used neo2 layers 5 and 6 so I would happily sacrifice them for a fully working layer 3. What about mapping caps lock to shift + mod4, i.e. shift + <? Using shiftmight still be a problem for shortcuts. Does the mod4 dead key approach work in shortcuts? One could then also map caps lock to a different dead key and use the same approach.

@jgosmann
Copy link
Owner

Personally, I have never used neo2 layers 5 and 6 so I would happily sacrifice them for a fully working layer 3.

My goal here is to provide a layout that is reasonably close to the “standard”, but you're welcome to make your own fork with personal adjustments. That's one of the advantages of open source after all. :)

Unfortunately, shift + mod4 reduces to the dead key approach mentioned above because all of layer 6 (shift + mod4) is implemented that way. There is no actual layer 6 defined in the keyboard layout itself. Layer 5 (shift + mod3/option) could work, but could collide with shift + option + something shortcuts in the same way as option + something does right now.

@PascalCremer
Copy link

Thanks! I'll give it a try and I understand that you want to keep this version as close to the standard as possible which is good.

jgosmann added a commit that referenced this issue Jun 20, 2019
@jgosmann
Copy link
Owner

I looked a bit more into this and might have a viable solution. It keeps the question mark in the keyboard layout where it is, but adds an alternative way to type a question mark via a dead key (where the final key is without modifiers and thus does not trigger shortcuts such as option+?). With an additional complex rule for Karabiner-Elements the usual keystroke to type ? can be redirected to this dead key variant.

To test this out:

  1. Install this keyboard layout file (you'll also find it in the fix-question-mark branch of this repository).
  2. Place this complex rule file in ~/.config/karabiner/assets/complex_modifications.
  3. Enable the "Prevent '?' from being treated as 'Option+?' shortcut rule.

It would be nice to get some feedback whether anyone experiences unexpected side effects.

Also, are there any other problematic keys that could use a similar fix?

@PascalCremer
Copy link

Hi, thanks for looking into this! I was trying to test your new layout but failed with the complex rule file. I think the problem might be that it is an .erb file. Can this go into ~/.config/karabiner/assets/complex_modificationsdirectly? My Karabiner Elements doesn't seem to pick it up. The log doesn't show anything either.

@jgosmann
Copy link
Owner

Sorry, I linked the wrong file. This is the correct one which gets generated from the .erb.

@PascalCremer
Copy link

PascalCremer commented Jun 23, 2019

I think you mean this file and this indeed works well, thank a lot! It fixes the problem both in Google docs as well as in the commit changes window of WebStorm (and probably any jetbrains IDE).

Other problematic keys I've encountered:

  • Any remaining combination using mod3 in commit changes window of WebStorm (When you type caps lock / option it underlines a character of options one might choose by pressing this particular character)
  • ) in chrome developer console
  • / in google docs
  • ?should give all possible hotkeys in gmail but it still doesn't work. I would like to have # work in gmail to delete messages

@PascalCremer
Copy link

PascalCremer commented Jun 23, 2019

I was able to disable mnemonics in WebStorm, which means the layout is working fine now.

image

@jgosmann
Copy link
Owner

Finally had some more time to work on this. I updated the keyboard layout file on the fix-question-mark branch to support the fix for (almost) all mod3 keys. For which keys it is activated depends on the Karabiner Elements rules. I extended the complex rule to include the characters mentioned here (?/#=)) and added a rule that activates it for (almost) all keys. I will test those a bit more and that officially release them.

@jgosmann
Copy link
Owner

I don't have GMail, so if you could let me know whether the issues there are fixed that would be great.

@cleeff
Copy link

cleeff commented Aug 18, 2019

Well done, thank you very much! I can confirm that the problems with WebStorm, the chrome console and google docs have gone away which is awesome!

Unfortunately, # still doesn't work in Gmail. For now others might find it useful to know that Gmail has recently added the possibility to change hotkeys.

@jgosmann
Copy link
Owner

Interestingly, the fixes introduce a new problem for me in Webstorm: it will insert an additional � character in front of all the layer three characters. 😐

@jgosmann
Copy link
Owner

jgosmann commented Sep 6, 2019

The problem in Webstorm (and other Jetbrains IDEs) is a bug reported upstream and has a workaround:
Open Help | Edit Custom Properties, add com.jetbrains.use.old.keyevent.processing=true and restart.

@jgosmann
Copy link
Owner

This has been fixed on master now.

@Phylu
Copy link

Phylu commented Jan 29, 2020

I have trouble using those modifications on MacOS Catalina. I enable the rule(s) from here: https://pqrs.org/osx/karabiner/complex_modifications/json/neo2.json
"Prevent all layer 3 keys from being treated as option key shortcut". This leads to layer 3 not working in any application anymore. Do I miss something?

@jgosmann
Copy link
Owner

It works fine for me on Catalina ...

@shutterzombie
Copy link

Hello jgosmann, thank you for your work!
I encountered the same problems as Phylu. In Microsoft Teams trying to type "?" opens the keyboard shortcuts popup. After activating "Prevent problematic keys from being treated as an option key shortcut", it simply types "s" in every program I've tried.

Is this fix dependent on the order of the modifications?

@Phylu
Copy link

Phylu commented Mar 26, 2020

Is this fix dependent on the order of the modifications?

I tried to change the order and also only enable subsets of the options, but so far, I have not been able to find any working configuration.

@jgosmann
Copy link
Owner

I still have no idea what the problem might be as it is still working for me. Maybe some additional information would be helpful:

  • Are you using an internal MacBook keyboard or an external keyboard? If it is an external keyboard, is it an Apple keyboard or some other brand?
  • Is it an ANSI or ISO keyboard?
  • What is the keyboard layout printed onto the keys (QWERTZ, QWERTY, ...)?

@jgosmann
Copy link
Owner

Also, for reference, this is the exact order of complex modifications that I have enabled:

  • Neo2 mod 3 and 4 keys (Apple keyboard)
  • Neo2 layer 4
  • Neo2 layer 6
  • Toggle caps_lock by pressing left_shift + right_shift at the same time
  • Prevent all layer 3 keys from being treated as option key shortcut

@Phylu
Copy link

Phylu commented Mar 27, 2020

@jgosmann Thanks for trying to solve this!

If I use the exact same order of complex modifications, the Prevent all layer 3 keys from being treated as option key shortcut rule still leads to e.g. s being printed instead of ? in all programs. I tested this with the following input devices:

  • MacBook Pro internal Keyboard. ISO - QWERTZ Layout
  • Kinesis Freestyle 2. ISO – QWERTZ Layout

Here the output from the Karabiner Elements Viewer without the rule enabled:

type:key_down        code:11         name:h               misc:
type:key_up          code:11         name:h               misc:
type:key_down        code:226        name:left_alt        misc:flags: left_alt 
type:key_down        code:11         name:h               misc:flags: left_alt 
type:key_up          code:11         name:h               misc:flags: left_alt 
type:key_up          code:226        name:left_alt        misc:

With the rule enabled:

type:key_down        code:11         name:h               misc:
type:key_up          code:11         name:h               misc:
type:key_down        code:226        name:left_alt        misc:flags: left_alt 
type:key_down        code:225        name:left_shift      misc:flags: left_alt,left_shift 
type:key_down        code:4          name:a               misc:flags: left_alt,left_shift 
type:key_up          code:4          name:a               misc:flags: left_alt,left_shift 
type:key_up          code:225        name:left_shift      misc:flags: left_alt 
type:key_up          code:226        name:left_alt        misc:
type:key_down        code:11         name:h               misc:
type:key_up          code:11         name:h               misc:

@jgosmann
Copy link
Owner

jgosmann commented Mar 27, 2020

Hm, that is exactly the same output that I get. 😕
Can you make sure that you have the most recent keyboard layout from jgosmann/neo2-layout-osx installed?

@Phylu
Copy link

Phylu commented Mar 27, 2020

Ok. That was a very stupid mistake. My keyboard layout file was from 2017. I updated the file and everything works properly now. Thanks a lot! :)

@shutterzombie
Copy link

Yep, that fixed it for me as well …
Thank you so much! You have no idea how happy this makes me :D
Stay safe!

@jgosmann
Copy link
Owner

Awesome. :)

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

No branches or pull requests

8 participants