From 8c8f4bfa2dcf7aaee2e0e7b364a667a28272e6e8 Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 12 Apr 2024 20:20:20 +0200 Subject: go --- src/i_events.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src/i_events.go') 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 = "" -- cgit v1.2.3