Skip to content

Commit

Permalink
Fix problem with uppercase transformation.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed May 19, 2023
1 parent 227f55a commit c18e3ba
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions bubbletea/adapter_bubbletea.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,18 @@ func (b *Adapter) HandleKeyPress() {
}

if val, ok := ebitenToTeaKeys[k]; ok {
runes := make([]rune, len(val.rune))
copy(runes, val.rune)

if ebiten.IsKeyPressed(ebiten.KeyShift) {
for i := range val.rune {
val.rune[i] = unicode.ToUpper(val.rune[i])
for i := range runes {
runes[i] = unicode.ToUpper(runes[i])
}
}

b.prog.Send(tea.KeyMsg{
Type: val.key,
Runes: val.rune,
Runes: runes,
Alt: ebiten.IsKeyPressed(ebiten.KeyAlt),
})
}
Expand Down

0 comments on commit c18e3ba

Please sign in to comment.