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

switching input method to zhuyin would change default key binding of editor.action.commentLine from cmd+/ to ctrl+alt+cmd+/ #31650

Closed
up9cloud opened this issue Jul 28, 2017 · 6 comments
Assignees
Labels
info-needed Issue requires more information from poster keyboard-layout Keyboard layout issues

Comments

@up9cloud
Copy link

up9cloud commented Jul 28, 2017

  • VSCode Version:v1.13.0
  • OS Version:OSX 10.11.6

Steps to Reproduce:

1.switch to Zhuyin input method.
2.ctrl + '/' to comment a line(typo)
2. cmd+/ to comment a line

Reproduces without extensions: No

Tried uninstalling all my extentions, same issue.

With --disable-extensions mode, I can type nothing (the ctrl+/ works) (typo) (the cmd+/ works).
In fact, all my inputs are broken with no extention mode except English input.

my input list
screen shot 2017-07-28 at 17 32 01

@rebornix
Copy link
Member

The comment shortcut is cmd+/ instead of ctrl+/. Can you verify that?

@rebornix rebornix added the info-needed Issue requires more information from poster label Jul 28, 2017
@up9cloud
Copy link
Author

Yes. it's my typo...
I'll update it.

@up9cloud up9cloud changed the title ctrl+/ broken with zhuyin input method. cmd+/ broken with zhuyin input method. Jul 29, 2017
@up9cloud
Copy link
Author

@rebornix is there any good news for this?

@alexdima alexdima added the keyboard-layout Keyboard layout issues label Oct 26, 2017
@alexdima alexdima self-assigned this Oct 26, 2017
@up9cloud
Copy link
Author

up9cloud commented Dec 8, 2017

@alexandrudima , @rebornix

i figure out why...
when i switch to input US, the default key of editor.action.commentLine is cmd+/
when i switch to input Zhuyin, the default key of editor.action.commentLine would be ctrl+alt+cmd+/

so i solve this issue by set keybindings.json to

[
  {
    "key": "cmd+[Slash]",
    "command": "editor.action.commentLine",
    "when": "editorTextFocus && !editorReadonly"
  },
  {
    "key": "ctrl+alt+cmd+[Slash]",
    "command": "-editor.action.commentLine",
    "when": "editorTextFocus && !editorReadonly"
  }
]

dose it work as expected?

@up9cloud up9cloud changed the title cmd+/ broken with zhuyin input method. switching input method to zhuyin would change default key binding of editor.action.commentLine from cmd+/ to ctrl+alt+cmd+/ Dec 8, 2017
@alexdima
Copy link
Member

@up9cloud The keyboard engine does the following with a default keybinding on OSX.

Let's consider cmd + /:

  • it will search for your current keyboard layout all possible keypresses and determine what character gets produced.
  • Under the US layout, [Slash] produces the /. The keybinding will be cmd+[Slash].
  • Under the DE layout, shift + [Digit7] produces the /. The keybinding will be cmd+shift+[Digit7].
  • I assume ctrl + alt + [Slash] produces the / under the Zhuyin keyboard layout. This can be verified by opening an editor and running F1 > Developer: Inspect Key Mappings. The keybinding will be ctrl+alt+cmd+[Slash].

It is perhaps unfortunate, but it tries to do the best it can given the plethora of keyboard layouts. You can upvote that we ship with keyboard layout optimized default keybindings in #1240

@up9cloud
Copy link
Author

@alexandrudima

the keybinding based on keyboard layout might cause issue here, because of

the zhuyin input has 2 mode

  • [caps lock] button off: this is zhuyin input with chinese mode
    • press [Slash] it will produce
    • press ctrl + [Slash] it will produce
    • press ctrl + alt + [Slash] it will produce
    • press alt + [Slash] it will produce
    • press shift + [Slash] it will produce
    • press ctrl + shift + [Slash] it will produce
    • press alt + shift + [Slash] it will produce
  • [caps lock] button on: this is zhuyin input with english mode
    • press [Slash] it will produce / **<= should work? **
    • press ctrl + [Slash] it will produce ``
    • press ctrl + alt + [Slash] it will produce /
    • press alt + [Slash] it will produce /
    • press shift + [Slash] it will produce ?
    • press ctrl + shift + [Slash] it will produce ``
    • press alt + shift + [Slash] it will produce ?

the F1 > Developer: Inspect Key Mappings

zhuyin chinese mode

...
	"Slash": {
		"value": "",
		"valueIsDeadKey": false,
		"withShift": "?",
		"withShiftIsDeadKey": false,
		"withAltGr": "/",
		"withAltGrIsDeadKey": false,
		"withShiftAltGr": "?",
		"withShiftAltGrIsDeadKey": false
	},
...

zhuyin english mode

...
	"Slash": {
		"value": "",
		"valueIsDeadKey": false,
		"withShift": "?",
		"withShiftIsDeadKey": false,
		"withAltGr": "/",
		"withAltGrIsDeadKey": false,
		"withShiftAltGr": "?",
		"withShiftAltGrIsDeadKey": false
	},
...

@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster keyboard-layout Keyboard layout issues
Projects
None yet
Development

No branches or pull requests

3 participants