Start a new topic

Key Sequence only in Royal TSX

One of my connection is a website that redirects me to a different URL for login. The redirected URL is unique per login attempt.

I've successfully configured an automatic key sequence to log into the site instead of relying on AutoFill.

One problem I'm having is that if something else takes focus or if I switch away to a different app before Royal TSX has executed the key sequence, it "types" and submits the username/password in whatever app is currently active.

I can't seem to find a way to restrict a key sequence to stay within Royal TSX. Am I missing something somewhere?

1 person has this problem

Hi Jackson, Pascal,

I think there are two issues that play into this:

  1. Jackson: With the direct input mode key sequence should never, ever end up in a different application unless the plugin/connection doesn't support direct input mode. That's actually the case if you're running a web page connection with the "Legacy" engine. Direct input mode is only supported for the modern engine. Could you please verify if you're running in "Legacy" mode?
  2. Pascal: We can reproduce the problem where key sequence output actually ends up somewhere else in the application. Unfortunately, it appears that there's a major bug in Apple's WebKit control that sends keyboard events to whatever control currently has focus if the web view is inaccessible (which is the case when it's hidden because it's tab is not selected). We will evaluate if there's any private APIs or different ways to send keyboard input to the web view even when it's hidden but I can't promise anything.



1 person likes this

Thanks for spending the time to look into this.

Regarding my web connection, it is definitely running in Modern mode.

If this is a limitation with Webkit then I completely understand. My initial intention regarding this topic was to make sure I wasn't doing something wrong.


1 person likes this

Perfect, thx for letting me know!

Yup, I did a quick test and the key sequence stayed in Royal TSX despite another app having focus. I also tried switching to a shell connection and the input still stayed within the web connection tab

Hehe, yeah, definitely the worse scenario.

Did you already check if the issue is solved for you?

Thanks for getting that fixed so quickly. I'm more concerned about another app stealing focus than me being dumb and opening another TSX connection.

Hi Jackson,

many thx for providing that video.

We found a pretty embarrassing bug that basically caused web connection to always execute key sequences in the old "Keyboard Input Simulation" mode. So direct mode was actually never used and that's why you saw the issue of text being typed into other application.

We just released an update for the plugin which fixes that issue. After installing the update you should not be able to reproduce the issue of text being entered in another application. The problem that text ends up in another part of Royal TSX will still be present though and is unfortunately related to how WebKit handles key presses.



Attached is a screen recording showing:

A web connection with a key sequence task working

A second connection changing to another application

A third connection changing to a new tab in Royal TSX.

After that I run through the settings on the connection, credential and key sequence.

Please let me know if you need more information.


Yes, the key sequence is configured to use direct mode. I made sure to set this as initially I had the key sequence configured directly as part of the connection.

I will set up some demo credentials and record a video and include it here.

Hi Jackson,

is your key sequence also set to run in direct mode?

If both, your key sequence is set to direct mode and your web connection is using the modern engine, no key strokes should end up in a different application.

If that's still the case, could you please record a short video that shows your web page connection configuration, your key sequence task configuration and exactly what happens when you execute the key sequence?



Hi Felix

Thank you and your team for looking into this. To me this is not a major issue. I will just have to remember to not navigate away from the active tab/window as long as a key sequence is running. But if you find ways to improve the current behaviour, the better.

Thanks again!

Hi guys,

I looked into this in more detail now and unfortunately it looks like there's no "clean" way to work around the limitation in WebKit.

I checked the WebKit source code and found that when WebKit "can't handle" a certain key press, it just falls back to sending it to the application which will then happily insert it into whatever view is currently active and accepts keyboard input.

Specifically, this is the link to the offending piece of code:

Now we could theoretically capture all NSEvent's sent to the application and ignore those that come from our keyboard simulation for key sequences which would prevent the characters from being entered into non-web fields. The problem with that approach is that it will greatly affect performance of Royal TSX since we need to inspect each and every NSEvent. So each time you move your mouse cursor, we have to inspect the event for that action and check if it's one of our own simulated events or a regular one. Unfortunately that's too much of a trade-off for us.

We will continue investigating other techniques to simulate keyboard input in WebKit but at the moment we don't have a viable solution unfortunately.



Hi Felix

Thanks for the feedback. I understand the issue and appreciate your work! Thank you.

Have Fun!

I am seeing the same behaviour Pascal is as well. I will attempt to filter out my company's information and submit some recording.

I am able to open a connection to a Web connection type with a Direct Input sequence task and then switch to another tab in Royal TSX. The key sequence will go through the motions in the new tab (in my case a terminal tab). I can also switch to an entirely new application and have Royal TSX type my key sequence in BBEdit.

Login or Signup to post a comment