Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F1-F12 keys support #81

Open
jcorbalan opened this issue Jan 22, 2017 · 16 comments
Open

F1-F12 keys support #81

jcorbalan opened this issue Jan 22, 2017 · 16 comments

Comments

@jcorbalan
Copy link

jcorbalan commented Jan 22, 2017

I have opened this issue so you can to answer for use of the F1 to F12 keys. Thank you.

When pressing the function keys F1-F12, in VT 240, instead of sending the standard escape sequence back to the server, WebTerminal sends the keyboard code of this key. Instead, the next table should be applied when using F1-F12 keys:

F1  ^[OP
F2  ^[OQ
F3  ^[OR
F4  ^[OS
F5  ^[[15~
F6  ^[[17~
F7  ^[[18~
F8  ^[[19~
F9  ^[[20~
F10 ^[[21~
F11 ^[[23~
F12 ^[[24~

Source

@nikitaeverywhere
Copy link
Member

@jcorbalan, thanks for opening the issue.

I have edited the issue so it now contains technical details to be implemented. Please confirm that this is correct.

@jcorbalan
Copy link
Author

yes, it's correct.

@nikitaeverywhere
Copy link
Member

@jcorbalan, one more fact I need to realize, does your terminal application work with Caché TERM? Maybe you use SSH clients like Putty to work with it. I cannot find out how to read the function keys in Caché TERM with one of these:

read *char
read string

If you have any suggestions, please comment. Thanks!

@jcorbalan
Copy link
Author

No, I work with TUN PLUS 2016 http://www.esker.com/host-access-software/tun.asp

@jcorbalan
Copy link
Author

The same problem is with arrow keys, don't work in webterminal, it's necesary
Reset Set
up EscA EscOA
down EscB EscOB
right EscC EscOC
left EscD EscOD

@nikitaeverywhere
Copy link
Member

I understood, thank you very much for clarifying this. I will get back in 1-2 days to this issue implementing required escape sequences, and then asking you to test the results (as I don't know any open solutions on M/COS languages to test this on).

@jcorbalan
Copy link
Author

OK, No problem, i test it.
Another drawback are the graphic character, you can see here:
http://www.theasciicode.com.ar/extended-ascii-code/graphic-character-low-density-dotted-ascii-code-176.html
they are the characteres from 176 to 223 . Now they are not shown in webterminal.
The sequence of escape necessary to activate or deactivate them is Esc(0 Esc)0 that Set G0 special chars. & line.
Please, yo can see : http://ascii-table.com/ansi-escape-sequences-vt-100.php

@nikitaeverywhere
Copy link
Member

Thanks! The idea is clear for now, let's deal first with function keys.

@jcorbalan
Copy link
Author

You can use this command in TERM:, to get the value of the PF key pressed, which will be stored in the variable PF.
READ E9#10
SET PF=$S($T=0:1,$ZB?.N:$ZB\256-31,$E($ZB,4)'=""&($A($ZB,4)'=126):$S($A($ZB,4)-49<5:$A($ZB,4)-39,1:$A($ZB,4)-49),$E($ZB,3)'="":$A($ZB,3)-79,1:-31)

@nikitaeverywhere
Copy link
Member

OK, @jcorbalan, you are welcome to test function and arrow keys support. Please install the attached WebTerminal version (it is not released yet). Here are the key mappings. They work as follows: both read *c and read c commands take mapped escape sequence to the variable c.

However, I haven't been able to

get the value of the PF key pressed, which will be stored in the variable PF.

in Caché TERM. Probably you meant to test it under TUN PLUS 2016? Thanks.

File: WebTerminal-v4.1.4.zip

@jcorbalan
Copy link
Author

Does not work, the program shows the characters of the function key that you have pressed, for example if you press F2, it is written "OQ", and nothing should be written

@nikitaeverywhere
Copy link
Member

@jcorbalan, I need to figure out how to test this.

READ E9#10
SET PF=$S($T=0:1,$ZB?.N:$ZB\256-31,$E($ZB,4)'=""&($A($ZB,4)'=126):$S($A($ZB,4)-49<5:$A($ZB,4)-39,1:$A($ZB,4)-49),$E($ZB,3)'="":$A($ZB,3)-79,1:-31)

This code does not work in Caché TERM, is it supposed to work there? Or should I use Putty/TUN PLUS 2016/etc to test how it works?

@jcorbalan
Copy link
Author

This code works inside a routine, not on the command line

READ E9#10
SET PF=$SELECT($TEST=0:1,$ZB?.N:$ZB\256-31,$EXTRACT($ZB,4)'=""&($ASCII($ZB,4)'=126):$SELECT($ASCII($ZB,4)-49<5:$ASCII($ZB,4)-39,1:$ASCII($ZB,4)-49),$EXTRACT($ZB,3)'="":$ASCII($ZB,3)-79,1:-31)

@nikitaeverywhere
Copy link
Member

@jcorbalan, it works as next:

2017-01-23_171603

It doesn't return nothing but 1 for all function keys despite you have stated:

You can use this command in TERM:, to get the value of the PF key pressed, which will be stored in the variable PF.

@jcorbalan
Copy link
Author

Please try this code

DUCK
I $ZV["M/SQL"!($ZV["ISM")!($ZV["Open M")!($ZV["Cache") W "Press F' Keys: "
READ E9#10
SET (PF,%PF5)=$SELECT($TEST=0:1,$ZB?.N:$ZB\256-31,$EXTRACT($ZB,4)'=""&($ASCII($ZB,4)'=126):$SELECT($ASCII($ZB,4)-49<5:$ASCII($ZB,4)-39,1:$ASCII($ZB,4)-49),$EXTRACT($ZB,3)'="":$ASCII($ZB,3)-79,1:-31)
write !, "PF: ", PF,!
Q

@nikitaeverywhere
Copy link
Member

Thank you!

I have found the problem: variable $ZB not changing in WebTerminal, whether in Caché TERM it changes:

USER>read A#9 zw $ZB
$c(27)_"OS"

(Caché TERM)

Let me find out how to make it work...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants