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

(Request) Don't swallow character inputs during keylock #94

Open
Christopher-Chappell opened this issue Apr 17, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@Christopher-Chappell
Copy link

This would greatly help in homegrown basic macros - the basic premise is I can paste in or in Terminal.app map a keyboard shortcut to a sequence of inputs, including tab, up/down/left/right, enter, and home. However, for inputs that send data to the host, there is some unknown latency before the host updates the screen. During this period the screen shows "KeyLock = 1" in highlighted text. During this period it seems that new character inputs get ignored. I can work around this in a number of cases, just by adding blanks in the space and guessing at how many blanks it will take before the screen refreshes. However, in some cases I need to have just the right cursor location or my cursor is somewhere that has data that I don't want to overwrite. If there was some way to either block input or cache keystrokes and only send them once keylock turns off again, it would simplify those macros greatly.

@najohnsn
Copy link
Member

Paste is not something that will work for this. It has already been defined that a linefeed in pasted data means the text that follows should be put below the previous - as if it is a block of text being pasted.

After pressing ENTER, the normal way a script would handle the KEYLOCK condition is to wait for it to clear before entering new text. There is no way to do this in your "simple macro" case.

I think I would prefer to provide more ways to execute a python code than make enhancements for a "simple macro". But maybe you could describe your use case some more? You want to ENTER multiple times with text entry in between? You want to trigger this macro from a keyboard "shortcut"? Would entering a command on the zti command prompt be reasonable?

@Christopher-Chappell
Copy link
Author

Paste is not something that will work for this. It has already been defined that a linefeed in pasted data means the text that follows should be put below the previous - as if it is a block of text being pasted.

Yeah, it's something I only was able to do with the new Windows terminal. For some reason, when I try to paste in multiple lines, it literally triggers the enter key, and then the characters after that are getting swallowed and put on different columns and who knows where stuff ends up.

After pressing ENTER, the normal way a script would handle the KEYLOCK condition is to wait for it to clear before entering new text. There is no way to do this in your "simple macro" case.

Exactly. Well, I don't have a script. I have zti, which doesn't really give me any way to run a script as far as I know. So I can only do what I've found works.

I think I would prefer to provide more ways to execute a python code than make enhancements for a "simple macro". But maybe you could describe your use case some more? You want to ENTER multiple times with text entry in between? You want to trigger this macro from a keyboard "shortcut"? Would entering a command on the zti command prompt be reasonable?

Here's an example - let's say I provisioned a new VICOM session but IBMUSER's account info got reset including the screen size. So I want a script that goes to ISPF option 0, deselects a couple fields, and sets screen size to MAX.

In Terminal.app on macos, I can do that (most of the time).
In my settings, I have a 3270 profile and I add a keyboard shortcut mapped to shift+f3:
image

Here's what's pasted into that text box:
0\015\033[H \033[H \033[H \033[B\011 \011\011\011\011 \033[19~\033[19~\033[19~\033[19~\033[H \033[H \033[H \033[H \033[H \033[H \033[B\011\011\011\011\01136\033[13~

And it works - but you can see I have \033[H followed by one or two spaces repeated several times following some of the escape characters, which is basically how I get around the swallowed inputs. I can guarantee I'm within a couple characters of the home position that way, and if I know where that position is then I can move the cursor around with a combination of tabs, backtabs, and arrow keys to get anywhere else. But as you can see a large part of this just getting around the whole swallowed input thing, and if I try to do a find command to get my cursor to a specific position on the screen, I can't really think of how to preserve the exact position of that cursor while sending inputs.

@najohnsn najohnsn added the enhancement New feature or request label Apr 23, 2024
@najohnsn najohnsn mentioned this issue Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants