Skip to content

Commit

Permalink
Merge pull request #39 from thaJeztah/windows_fix_string_conversion
Browse files Browse the repository at this point in the history
windows: keyToString(): fix string conversion
  • Loading branch information
thaJeztah committed Apr 30, 2023
2 parents 13e9088 + 2ce69ef commit 0878220
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions windows/ansi_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"io"
"os"
"strconv"
"strings"
"unsafe"

Expand Down Expand Up @@ -195,10 +196,10 @@ func keyToString(keyEvent *winterm.KEY_EVENT_RECORD, escapeSequence []byte) stri

// <Alt>+Key generates ESC N Key
if !control && alt {
return ansiterm.KEY_ESC_N + strings.ToLower(string(keyEvent.UnicodeChar))
return ansiterm.KEY_ESC_N + strings.ToLower(strconv.Itoa(int(keyEvent.UnicodeChar)))
}

return string(keyEvent.UnicodeChar)
return strconv.Itoa(int(keyEvent.UnicodeChar))
}

// formatVirtualKey converts a virtual key (e.g., up arrow) into the appropriate ANSI string.
Expand Down

0 comments on commit 0878220

Please sign in to comment.