You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
First thing is thanks for cool packages to utilize x3270, I'm using it a lot you know because work related
The problem is, it looks like we can't send F1-F12 key function because validaKeyboard() function always return false in case we send F1-F12 key even it's provided in constant variables causing all variables apart from Enter and Tab useless.
// These constants represent the keyboard keys
const (
Enter = "Enter"
Tab = "Tab"
F1 = "PF(1)"
F2 = "PF(2)"
F3 = "PF(3)"
F4 = "PF(4)"
F5 = "PF(5)"
F6 = "PF(6)"
F7 = "PF(7)"
F8 = "PF(8)"
F9 = "PF(9)"
F10 = "PF(10)"
F11 = "PF(11)"
F12 = "PF(12)"
)
......
//Press press a keyboard key
func (e *Emulator) Press(key string) error {
if !e.validaKeyboard(key) {
return fmt.Errorf("invalid key %s", key)
}
return e.execCommand(key)
}
//validaKeyboard valid if key passed by parameter if a key valid
func (e *Emulator) validaKeyboard(key string) bool {
switch key {
case Tab:
return true
case Enter:
return true
default:
return false
}
}
Should be checked whether it's key command function or not and send command below for example : x3270if -t e.ScriptPort PF(1)
Maybe adding more function for PF key or just checking input in press() will solve the problem.
Thanks.
The text was updated successfully, but these errors were encountered:
Sorry for delay...It's really nice to see that this package have been used.
Now, about the issue, implementation seems simple. Could you send a PR with fix?
Hi,
First thing is thanks for cool packages to utilize x3270, I'm using it a lot you know because work related
The problem is, it looks like we can't send F1-F12 key function because validaKeyboard() function always return false in case we send F1-F12 key even it's provided in constant variables causing all variables apart from
Enter
andTab
useless.Should be checked whether it's key command function or not and send command below for example :
x3270if -t e.ScriptPort PF(1)
Maybe adding more function for PF key or just checking input in press() will solve the problem.
Thanks.
The text was updated successfully, but these errors were encountered: