[2.0.x] Citrix issue with keyboard --- use Settings.AutoDetectKeyboardLayout = False

Asked by filleton on 2019-10-24

I'm actually working on a citrix app, when i'm trying to use some keyboards inputs, it does not work.

Example :
type(Key.ENTER) #does not work
type("\n") #does not work

I also tryed this : but it does not work either

How can I fix it?

type("Some text") #Works

Note that all works in a local app (ie: notepad)
Thank you.

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:

This question was originally filed as bug #1849674.

RaiMan (raimund-hocke) said : #1

sorry, but I do not accept bugs for such special environments.

RaiMan (raimund-hocke) said : #2

You have to find out, wether Java AWT Robot actions (internally used by SikuliX) are restricted against a Citrix window.

Does click() work?

Try to run from a administrator command line.

filleton (filleton) said : #3

Yes, click() works

Ok, thank you for the answer.

No, with the administrator command line it does not work.

Maybe it's a hint, but I have sometimes this error on the 'type' instruction :
[error] script [ test ] stopped with error in line 3
[error] java.lang.IllegalArgumentException ( java.lang.IllegalArgumentException: Key: Not supported character: B )
[error] --- Traceback --- error source first

RaiMan (raimund-hocke) said : #4

--- [error] java.lang.IllegalArgumentException ( java.lang.IllegalArgumentException: Key: Not supported character: B )

... and what is the related type(???)

Are there any special setups in your context with relation to KeyBoardLayout (which is autodetected in latest SikuliX on Windows)?

Matthias Balmer (mbalmer) said : #5

We use SikuliX with Citrix quite frequently. Had no issues so far concerning keyboard layout.

Do you have the same keyboard layout inside the Citrix session and on the machine you run the test from?

You can also try to disable automatic keyboard layout detection at the very start of your script:

Settings.AutoDetectKeyboardLayout = False

But then you have to ensure that both sides have the en_US layout configured and active.

Launchpad Janitor (janitor) said : #6

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

filleton (filleton) said : #7

Sorry for the late answer :

Settings.AutoDetectKeyboardLayout = False is working, I have access to the 'Enter' key with this instruction first.

Thank you everybody!

filleton (filleton) said : #8

Thank you, I close the subject.