zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Change MOUSE_SELECTION_KEY to Fn + cmd

Open Khushiyant opened this issue 3 years ago • 6 comments

What does this PR do?

MOUSE_SELECTION_KEY is changed to Fn + cmd in MacOS platform

Testing

  • [x] Manually
  • [x] Passed linting & tests (each commit)

Commit changes

- MOUSE_SELECTION_KEY = "Fn + Alt" if PLATFORM == "MacOS" else "Shift"
+ MOUSE_SELECTION_KEY = "Fn + cmd" if PLATFORM == "MacOS" else "Shift"

Visual changes

Before Screenshot 2022-10-19 at 1 28 09 PM

After Screenshot 2022-10-19 at 1 29 29 PM

Changed to Fn+cmd is used to avoid confusion due to Mac keyboard layout

Khushiyant avatar Oct 19 '22 08:10 Khushiyant

@neiljp Please check

Khushiyant avatar Oct 19 '22 18:10 Khushiyant

I don't use a mac so this is difficult for me to confirm personally.

Which terminal emulators have you tested this on?

My understanding is that depending on the terminal emulator, eg. Terminal (built-in) or iTerm (app that some use), Alt/cmd may work differently, see for example https://github.com/zulip/zulip-terminal/issues/680#issuecomment-640977268

Are you about on chat.zulip.org?


If this does resolve this one particular case across terminals, more generally I'd like to combine this fix with a translation of the Meta which is necessary for urwid to understand, into something like physical_key_representing_meta() for user output (in platform_code.py), since Meta is not an available physical key in most cases.

Note that resolving the Mac (and cross-platform) situation properly would involve documenting the situation via #873, as well as ensuring we address points that have come up in topics that have come up in

  • https://chat.zulip.org/#narrow/stream/206-zulip-terminal/topic/Alt.20.2F.20Meta.20keys
  • https://chat.zulip.org/#narrow/stream/206-zulip-terminal/topic/About.20Popup.20.28alt.2Fmeta.29

neiljp avatar Oct 19 '22 18:10 neiljp

@neiljp

  • I have used the default zsh terminal for testing
  • I feel that key mapping for above problem is correct but instruction text is displayed wrong according to Mac keyboard layout since there is no Alt in it.

In case of documentation, I'll change the things accordingly

Khushiyant avatar Oct 20 '22 20:10 Khushiyant

@Khushiyant I was referring to the application you're using to run zsh (which itself is a shell), so that doesn't quite answer my question.

neiljp avatar Oct 21 '22 03:10 neiljp

@neiljp I have tested the change on Terminal(built-in, ver 2.12.7) and also on iTerm

Khushiyant avatar Oct 21 '22 11:10 Khushiyant

Hello @zulip/server-hotkeys members, this pull request was labeled with the "area: hotkeys" label, so you may want to check it out!

zulipbot avatar Jun 23 '24 18:06 zulipbot