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

Toggle checkbox keybinding no longer works in version 3.6.0 or newer #1381

Closed
joneshf-dd opened this issue Jan 9, 2024 · 9 comments
Closed
Labels
Area: Input Related to editor input processing (key presses, key bindings). Issue: Question Res: As expected The existing behavior is by design or as expected.

Comments

@joneshf-dd
Copy link

What's the problem

Toggle checkbox keybinding no longer works in version 3.6.0 or 3.6.1. This behavior works in 3.5.1.

What's the expected result

When pressing the toggle checkbox keybinding (Option+C on macOS by default), it should toggle the checkbox.

How to reproduce

  1. Install 3.6.0 or 3.6.1.
  2. Make a checkbox
    - [ ] Something
  3. Press Option+C (or the equivalent).
  4. It will not toggle the checkbox.

Other information

You can validate that it still works in 3.5.1 by downgrading the extension and running through the same reproduction steps.

@yzhang-gh
Copy link
Owner

Thanks for the feedback. I forgot to mention that this key binding was removed for Mac as it overrides a character in other languages (#1285). You can assign it back to the command markdown.extension.checkTaskList. This is also the case for markdown.extension.editing.toggleStrikethrough which had the key binding alt+s.

@yzhang-gh yzhang-gh added Area: Input Related to editor input processing (key presses, key bindings). Res: As expected The existing behavior is by design or as expected. labels Jan 10, 2024
@xiecang
Copy link

xiecang commented Jan 16, 2024

My reassignment to Option+C doesn't seem to work, do I need to bind it to another shortcut?

@yzhang-gh
Copy link
Owner

You can use this method to check what VS Code is doing after you pressed the key binding.

image

@xiecang
Copy link

xiecang commented Jan 16, 2024

When I press option+C, I get this log:

2024-01-16 21:37:54.683 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-01-16 21:37:54.700 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2024-01-16 21:37:54.700 [info] [KeybindingService]: / Received keydown event - modifiers: [alt], code: AltLeft, keyCode: 18, key: Alt
2024-01-16 21:37:54.700 [info] [KeybindingService]: | Converted keydown event - modifiers: [alt], code: AltLeft, keyCode: 6 ('Alt')
2024-01-16 21:37:54.700 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2024-01-16 21:37:55.007 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-01-16 21:37:55.007 [info] [KeybindingService]: | Resolving alt+[KeyC]
2024-01-16 21:37:55.007 [info] [KeybindingService]: \ No keybinding entries.
2024-01-16 21:37:55.007 [info] [KeybindingService]: / Received keydown event - modifiers: [alt], code: KeyC, keyCode: 67, key: ç
2024-01-16 21:37:55.008 [info] [KeybindingService]: | Converted keydown event - modifiers: [alt], code: KeyC, keyCode: 33 ('C')
2024-01-16 21:37:55.008 [info] [KeybindingService]: | Resolving alt+[KeyC]
2024-01-16 21:37:55.008 [info] [KeybindingService]: \ No keybinding entries.
2024-01-16 21:37:55.253 [info] [KeybindingService]: + Ignoring single modifier alt due to it being pressed together with other keys.

this is my shortcut configuration.
image

@yzhang-gh
Copy link
Owner

That is because you set when to false, which means never. Try e.g. (remove the !isMac condition)

"command": "markdown.extension.checkTaskList",
"key": "alt+c",
"when": "editorTextFocus && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && !isMac"

@xiecang
Copy link

xiecang commented Jan 16, 2024

That is because you set when to false, which means never. Try e.g. (remove the !isMac condition)

"command": "markdown.extension.checkTaskList",
"key": "alt+c",
"when": "editorTextFocus && editorLangId =~ /^markdown$|^rmd$|^quarto$/ && !isMac"

Thank you so much, the changes worked perfectly following your configuration.

@joneshf-dd
Copy link
Author

Thanks for the feedback. I forgot to mention that this key binding was removed for Mac as it overrides a character in other languages (#1285). You can assign it back to the command markdown.extension.checkTaskList. This is also the case for markdown.extension.editing.toggleStrikethrough which had the key binding alt+s.

I see. Any chance the extension itself could change the key binding to something else? I don't really care if I use Option+C or something else, but I'd like to not have to remember to override the keybinding for different macOS machines.

@Gorzas
Copy link

Gorzas commented Jan 25, 2024

Not much experience using MacOS, but could be the key binding be Ctrl + c and Ctrl + s? Or maybe make it configurable per user.

@yzhang-gh
Copy link
Owner

Hi, sorry for the late reply. It is hard to find an easy-to-remember but not-yet-been-used key binding. (There are many issues in this repository complaining about the default key bindings.)

I'd like to not have to remember to override the keybinding for different macOS machines

@joneshf-dd I would suggest sync your settings/profiles with a GitHub account. VS Code had been developed/polished this feature for a long time and I feel it is easy to use.

Or maybe make it configurable per user

@Gorzas You can configure the key binding with VS Code's keyboard shortcuts editor (The commands are markdown.extension.checkTaskList and markdown.extension.editing.toggleStrikethrough). And again, it can be synced with an account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Input Related to editor input processing (key presses, key bindings). Issue: Question Res: As expected The existing behavior is by design or as expected.
Projects
None yet
Development

No branches or pull requests

4 participants