aboutsummaryrefslogtreecommitdiffstats
path: root/src/i_events.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-04-15 20:20:20 +0200
committerJoe <rbo@gmx.us>2024-04-15 20:20:20 +0200
commitdde1a1b8554a6ebc3725ce730b62655c77cda01a (patch)
tree8e1bc16118d4260f47ad1f2d00ab4905a3260f06 /src/i_events.go
parentgogo (diff)
downloadhardflip-dde1a1b8554a6ebc3725ce730b62655c77cda01a.tar.gz
hardflip-dde1a1b8554a6ebc3725ce730b62655c77cda01a.tar.bz2
hardflip-dde1a1b8554a6ebc3725ce730b62655c77cda01a.tar.xz
hardflip-dde1a1b8554a6ebc3725ce730b62655c77cda01a.tar.zst
hardflip-dde1a1b8554a6ebc3725ce730b62655c77cda01a.zip
coool
Diffstat (limited to '')
-rw-r--r--src/i_events.go35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/i_events.go b/src/i_events.go
index 63463bf..6468588 100644
--- a/src/i_events.go
+++ b/src/i_events.go
@@ -54,6 +54,7 @@ package main
import (
"os"
"strconv"
+ "strings"
"github.com/gdamore/tcell/v2"
"golang.org/x/term"
@@ -593,6 +594,16 @@ func i_events(data *HardData) {
} else if event.Rune() == 'i' ||
event.Rune() == 'a' ||
event.Key() == tcell.KeyEnter {
+ if data.ui.insert_sel == INS_RDP_DYNAMIC {
+ if data.insert.Dynamic == true {
+ data.insert.Dynamic = false
+ } else {
+ data.insert.Dynamic = true
+ }
+ ui.buff = ""
+ ui.s.HideCursor()
+ break
+ }
data.ui.insert_sel_ok = true
switch data.ui.insert_sel {
case INS_SSH_HOST,
@@ -621,6 +632,8 @@ func i_events(data *HardData) {
case INS_SSH_JUMP_PRIV: ui.buff = data.insert.Jump.Priv
case INS_RDP_DOMAIN: ui.buff = data.insert.Domain
case INS_RDP_FILE: ui.buff = data.insert.RDPFile
+ case INS_RDP_SCREENSIZE: break
+ case INS_RDP_DYNAMIC: break
case INS_RDP_QUALITY: break
case INS_SSH_OK,
INS_RDP_OK:
@@ -658,6 +671,26 @@ func i_events(data *HardData) {
ui.s.HideCursor()
i_set_protocol_defaults(data, data.insert)
}
+ case INS_RDP_SCREENSIZE:
+ if event.Rune() < '1' || event.Rune() > '7' {
+ data.ui.insert_sel_ok = false
+ ui.buff = ""
+ ui.s.HideCursor()
+ break
+ } else {
+ s := strings.Split(
+ RDP_SCREENSIZE[uint8(event.Rune() - 48 - 1)],
+ "x")
+ if len(s) != 2 {
+ return
+ }
+ tmp, _ := strconv.Atoi(s[W])
+ data.insert.Width = uint16(tmp)
+ tmp, _ = strconv.Atoi(s[H])
+ data.insert.Height = uint16(tmp)
+ data.ui.insert_sel_ok = false
+ ui.s.HideCursor()
+ }
case INS_RDP_QUALITY:
if event.Rune() < '1' || event.Rune() > '3' {
data.ui.insert_sel_ok = false
@@ -669,8 +702,6 @@ func i_events(data *HardData) {
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,