Skip to content

Commit

Permalink
Merge branch 'master' into feature/zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Aug 28, 2023
2 parents d00cbc5 + 75519d2 commit 1a89b6d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions input.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (t *Terminal) TypedRune(r rune) {
// TypedKey will be called if a non-printable keyboard event occurs
func (t *Terminal) TypedKey(e *fyne.KeyEvent) {
if t.keyboardState.shiftPressed {
t.KeyTypedWithShift(e)
t.keyTypedWithShift(e)
return
}

Expand Down Expand Up @@ -73,7 +73,7 @@ func (t *Terminal) TypedKey(e *fyne.KeyEvent) {
}
}

func (t *Terminal) KeyTypedWithShift(e *fyne.KeyEvent) {
func (t *Terminal) keyTypedWithShift(e *fyne.KeyEvent) {
switch e.Name {
case fyne.KeyF1:
_, _ = t.in.Write([]byte{asciiEscape, '[', '2', '5', '~'})
Expand Down Expand Up @@ -122,7 +122,7 @@ func (t *Terminal) KeyTypedWithShift(e *fyne.KeyEvent) {
}
}

func (t *Terminal) TrackKeyboardState(down bool, e *fyne.KeyEvent) {
func (t *Terminal) trackKeyboardState(down bool, e *fyne.KeyEvent) {
switch e.Name {
case desktop.KeyShiftLeft:
t.keyboardState.shiftPressed = down
Expand All @@ -139,12 +139,14 @@ func (t *Terminal) TrackKeyboardState(down bool, e *fyne.KeyEvent) {
}
}

// KeyDown is called when we get a down key event
func (t *Terminal) KeyDown(e *fyne.KeyEvent) {
t.TrackKeyboardState(true, e)
t.trackKeyboardState(true, e)
}

// KeyUp is called when we get an up key event
func (t *Terminal) KeyUp(e *fyne.KeyEvent) {
t.TrackKeyboardState(false, e)
t.trackKeyboardState(false, e)
}

// FocusGained notifies the terminal that it has focus
Expand Down

0 comments on commit 1a89b6d

Please sign in to comment.