-
Notifications
You must be signed in to change notification settings - Fork 267
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
Unable to send and record some alt modifier sequences #442
Comments
See pull request #441 for the fix to both these issues. The correct output displayed in the screenshot section is the result from the fixed branch. |
@maaslalani Are you able to verify this issue exists for you as well? |
@maaslalani You probably missed this issue with the flurry of issues and pull requests I have been creating. Can we verify this issue is reproducible and check that the pull request does fix the issue? |
I am basing |
DefinitionI think it is important to firstly clarify what the For me, on a Mac, I am pressing the We need to remove what terminal and OS (and even keyboard) is being used and just look at it as messages. What really matters is what Therefore, let's base the answer on what TestingSo we need two parts to prove this.
ApplicationThe following code is a short Bubbletea application that responds to package main
import (
"fmt"
tea "github.com/charmbracelet/bubbletea"
)
type Model struct {
state bool
text string
}
func main() {
p := tea.NewProgram(Model{
state: false,
text: "disabled",
})
if _, err := p.Run(); err != nil {
panic(err)
}
}
func (m Model) Init() tea.Cmd {
return nil
}
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
switch msg.String() {
case "alt+s":
switch m.state {
case true:
m.text = "disabled"
m.state = false
default:
m.text = "enabled"
m.state = true
}
case "ctrl+c", "q":
return m, tea.Quit
}
}
return m, nil
}
func (m Model) View() string {
return fmt.Sprintf("Press Alt+S to toggle state\nState: %v\n", m.text)
} TapeNow lets add a VHS tape that will run this app and send the
ResultsAll that was needed was to now run VHS on this tape:
VHS stable releaseI have used the current release provided by Homebrew. Reported version is:
As you can see, nothing happens. VHS branch fix/altThis is using the code I have provided in pull request #441. This shows the text message toggles. OutcomeBased on these results I conclude that the current VHS implementation sending some @maaslalani Let me know if there is any further details you need me to provide so we can understand what the correct solution is. |
Describe the bug
Sending and recording alt modifier sequences with alphanumeric key presses does not work.
Setup
Please complete the following information along with version numbers, if applicable.
For macOS
showkey
needs to be installed:For Linux use:
To Reproduce
Sending
Here is a tape file demonstrating the sending problem:
Incorrect output:
Recording
Steps:
vhs record > alt.tape
showkey
ALT
andS
CTRL
andC
to quitshowkey
CTRL
andD
to end recordingcat alt.tape | grep Alt
Expected behavior
Sending
The showkey output should display:
Recording
The
alt.tape
should display:Screenshots
Incorrect result:
Correct output:
The text was updated successfully, but these errors were encountered: