Skip to content

Commit

Permalink
Merge pull request #6 from knz/20221108-keys
Browse files Browse the repository at this point in the history
  • Loading branch information
knz authored Nov 8, 2022
2 parents 4c48291 + 773b740 commit a0e01fe
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,5 +514,7 @@ var allKeys = func() map[string]tea.Key {
}
result[keyName] = k
}
result["space"] = tea.Key{Type: tea.KeySpace, Runes: []rune(" ")}
result["backspace"] = tea.Key{Type: tea.KeyBackspace}
return result
}()
24 changes: 23 additions & 1 deletion testdata/simple
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,39 @@ TEA PRINT: {MODEL UPDATE}
MODEL VIEW🛇

run trace=on
key space
key backspace
key ctrl+c
key alt+c
key alt+ctrl+down
----
-- trace: before "key space"
-- trace: after "key"
-- view:
MODEL VIEW🛇
-- trace: before "key backspace"
-- trace: processing 1 messages
-- trace: msg tea.KeyMsg{Type:-12, Runes:[]int32{32}, Alt:false}
-- trace: processing 1 cmds
-- trace: translated cmd: tea.printLineMessage
-- trace: after "key"
-- view:
MODEL VIEW🛇
-- trace: before "key ctrl+c"
-- trace: processing 2 messages
-- trace: msg tea.KeyMsg{Type:127, Runes:[]int32(nil), Alt:false}
-- trace: msg tea.printLineMessage{messageBody:"MODEL UPDATE"}
TEA PRINT: {MODEL UPDATE}
-- trace: processing 1 cmds
-- trace: translated cmd: tea.printLineMessage
-- trace: after "key"
-- view:
MODEL VIEW🛇
-- trace: before "key alt+c"
-- trace: processing 1 messages
-- trace: processing 2 messages
-- trace: msg tea.KeyMsg{Type:3, Runes:[]int32(nil), Alt:false}
-- trace: msg tea.printLineMessage{messageBody:"MODEL UPDATE"}
TEA PRINT: {MODEL UPDATE}
-- trace: processing 1 cmds
-- trace: translated cmd: tea.printLineMessage
-- trace: after "key"
Expand Down

0 comments on commit a0e01fe

Please sign in to comment.