vhs icon indicating copy to clipboard operation
vhs copied to clipboard

Fix alt modifier

Open mikelorant opened this issue 6 months ago • 9 comments

The alt modifier was not handled correctly for both sending and recording key presses.

To send the key press, the ESC sequences needs to be transmitted before the key.

For recording, the escape sequences lookup table had to be updated with all alphanumeric combinations.

Syntax highlights had also not been updated.

mikelorant avatar Feb 04 '24 07:02 mikelorant

@maaslalani Can you review this. Thanks.

mikelorant avatar Feb 04 '24 23:02 mikelorant

Thanks so much @mikelorant! ❤️

maaslalani avatar Feb 28 '24 22:02 maaslalani

Does this work for you? It doesn't seem to work correctly for me on MacOS. This is pressing Alt+Left and Alt+Right.

image

maaslalani avatar Feb 28 '24 22:02 maaslalani

I'm wondering if this comes down to what alt means?

escplus

My own tests were from macOS. Can you install showkey and see what you get?

mikelorant avatar Feb 28 '24 22:02 mikelorant

@maaslalani Please see issue #442 for the details. I believe you do not have your terminal set correctly and are not actually sending what is considered the alt key.

mikelorant avatar Mar 05 '24 09:03 mikelorant

Further testing has made things a bit more confusing.

WezTerm

alt + b = <ESC>b alt + = <ESC>[1;3D

macOS Terminal

alt + b = <ESC>b alt + = <ESC>b

mikelorant avatar Mar 05 '24 09:03 mikelorant

May have a solution for you, will test this out tomorrow and update the pull request.

  • For 0 to 9 and a to z send ESC + character.
  • Everything else, hold down alt and send the key press (method currently used for enter and tab).

In terms of recording, need to do some brainstorming. Only have the tables to lookup against. May need to add all the key presses we can think of.

What terminal are you using?

mikelorant avatar Mar 05 '24 09:03 mikelorant