[1.1.1] macOS 10.12 Sierra: type("test") only types tt in google search field and other input fields/areas--- workaround

Bug #1673089 reported by RaiMan
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
SikuliX
Confirmed
Wishlist
RaiMan

Bug Description

*************************** workaround
use paste() for the text parts and type() only for typing functional keys:
paste("test"); type(Key.ENTER)

or switch of the accented popup behavior (see below)

----------------- findings until now
Seems to be related to the possible selection of accented characters if the key is held for some time (which is valid for e and s).

The problem seems to be somewhere between the handling of the input field input and the way Java Robot types a character.

according to https://infinitediaries.net/os-x-choose-between-the-character-accents-popup-and-key-repeat-when-holding-down-a-key/

switch back to repeat key from accented character popup:
**** In a Terminal: defaults write -g ApplePressAndHoldEnabled -bool false
In this mode type works as expected.

switch back reverse (popup again) (default in macOS Sierra).
**** In a Terminal: defaults write -g ApplePressAndHoldEnabled -bool false

**** problem for SikuliX: cannot be done on the fly, since the offending application has to be stopped and restarted again.

**** in Terminal: defaults read -g ApplePressAndHoldEnabled
reveals you current setting:
0: no accented character popup (type should work as expected)
1: you get accented character popup, type makes problems

--------------------------------------------

We are experiencing issues with type() command under Mac OS Sierra.

-- while typing accent menu appear - see https://support.apple.com/library/APPLE/APPLECARE_ALLGEOS/Product_Help/en_US/PUBLIC_USERS/PL124/S0120_AccentMenu.png

-- typing actually miss some chars. For example typing "test" results in "tt" - https://www.screencast.com/t/xL79S0JK

-- typing doesn't fire onKeyUp event in some fields(typing manually fires events)

Please note that we do not have above issues with El Capitan and Yosemite Mac OS versions. We tried latest nightly Sikuli build as well. Java versions we are using is 1.8.121(latest)

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → High
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 1.1.1
RaiMan (raimund-hocke)
Changed in sikuli:
status: In Progress → Opinion
importance: High → Undecided
RaiMan (raimund-hocke)
summary: - [1.1.1] macOS 10.12 Sierra: type("test") only types tt in various input
- situations (browser address, textedit, google search field, ...)
+ [1.1.1] macOS 10.12 Sierra: type("test") only types tt in google search
+ field
Changed in sikuli:
status: Opinion → Confirmed
summary: [1.1.1] macOS 10.12 Sierra: type("test") only types tt in google search
- field
+ field --- workaround
RaiMan (raimund-hocke)
description: updated
RaiMan (raimund-hocke)
description: updated
RaiMan (raimund-hocke)
description: updated
RaiMan (raimund-hocke)
Changed in sikuli:
importance: Undecided → High
description: updated
summary: [1.1.1] macOS 10.12 Sierra: type("test") only types tt in google search
- field --- workaround
+ field and other input fields/areas--- workaround
RaiMan (raimund-hocke)
description: updated
RaiMan (raimund-hocke)
description: updated
Changed in sikuli:
importance: High → Wishlist
RaiMan (raimund-hocke)
description: updated
Revision history for this message
TestMechanic (ndinev) wrote :

We actually tried the workaround before posting the problem to Sikuli forum. It does not seems to work well.

I created pure java code that reproduces the problem

------------------------------------------------------

import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;

public class RobotExp {

  public static void main(String[] args) {

        try {

            Robot robot = new Robot();
            // Creates the delay of 5 sec so that you can open notepad before
            // Robot start writting
            System.out.println("You have 5 seconds to focus typing target");

            robot.delay(5000);
            System.out.println("Typing...");
            robot.delay(300);
            robot.keyPress(KeyEvent.VK_T);
            robot.delay(300);
            robot.keyPress(KeyEvent.VK_E);
            robot.delay(300);
            robot.keyPress(KeyEvent.VK_S);
            robot.delay(300);
            robot.keyPress(KeyEvent.VK_T);
            robot.delay(300);
            System.out.println("Done.");

        } catch (AWTException e) {
            e.printStackTrace();
        }
    }
}

Revision history for this message
RaiMan (raimund-hocke) wrote :

Not sure what you want to tell me.

After having switched of the accented popup behavior as mentioned, it worked for me.

RaiMan (raimund-hocke)
Changed in sikuli:
milestone: 1.1.1 → 2.0.5
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.