diff options
author | Joe <rbo@gmx.us> | 2024-04-12 20:20:20 +0200 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-04-12 20:20:20 +0200 |
commit | 8c8f4bfa2dcf7aaee2e0e7b364a667a28272e6e8 (patch) | |
tree | 5b26bbfd8f0044d3c30914200375f51ef2a5d705 /src/i_events.go | |
parent | commit (diff) | |
download | hardflip-8c8f4bfa2dcf7aaee2e0e7b364a667a28272e6e8.tar.gz hardflip-8c8f4bfa2dcf7aaee2e0e7b364a667a28272e6e8.tar.bz2 hardflip-8c8f4bfa2dcf7aaee2e0e7b364a667a28272e6e8.tar.xz hardflip-8c8f4bfa2dcf7aaee2e0e7b364a667a28272e6e8.tar.zst hardflip-8c8f4bfa2dcf7aaee2e0e7b364a667a28272e6e8.zip |
go
Diffstat (limited to 'src/i_events.go')
-rw-r--r-- | src/i_events.go | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/i_events.go b/src/i_events.go index 35f7a4c..63463bf 100644 --- a/src/i_events.go +++ b/src/i_events.go @@ -658,6 +658,19 @@ func i_events(data *HardData) { ui.s.HideCursor() i_set_protocol_defaults(data, data.insert) } + case INS_RDP_QUALITY: + if event.Rune() < '1' || event.Rune() > '3' { + data.ui.insert_sel_ok = false + ui.buff = "" + ui.s.HideCursor() + break + } else { + data.insert.Quality = uint8(event.Rune() - 48 - 1) + data.ui.insert_sel_ok = false + ui.s.HideCursor() + } + // tmp, _ := strconv.Atoi(ui.buff) + // data.insert.Quality = uint8(tmp) case INS_SSH_HOST, INS_SSH_PORT, INS_SSH_USER, @@ -673,8 +686,7 @@ func i_events(data *HardData) { INS_RDP_DOMAIN, INS_RDP_USER, INS_RDP_PASS, - INS_RDP_FILE, - INS_RDP_QUALITY: + INS_RDP_FILE: if event.Key() == tcell.KeyEnter { switch data.ui.insert_sel { case INS_SSH_HOST, @@ -713,9 +725,6 @@ func i_events(data *HardData) { data.insert.Domain = ui.buff case INS_RDP_FILE: data.insert.RDPFile = ui.buff - case INS_RDP_QUALITY: - tmp, _ := strconv.Atoi(ui.buff) - data.insert.Quality = uint8(tmp) } data.ui.insert_sel_ok = false ui.buff = "" |