All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sikuli.script.Keys Maven / Gradle / Ivy

There is a newer version: 2.0.5
Show newest version
/*
 * Copyright 2010-2014, Sikuli.org, sikulix.com
 * Released under the MIT License.
 *
 * modified RaiMan
 */
package org.sikuli.script;

import org.sikuli.basics.Debug;

/**
 * Main pupose is to coordinate the keyboard usage among threads 
* At any one time, the keyboard has one owner (usually a Region object)
* who exclusively uses the keyboard, all others wait for the keyboard to be free again
* if more than one possible owner is waiting, the next owner is uncertain
* It is detected, when the keyboard is usaed externally of the workflow, which can be used for appropriate actions * (e.g. pause a script)
* the keyboard can be blocked for a longer time, so only this owner can use the keyboard (like some transactional * processing)
* Currently deadlocks and infinite waits are not detected, but should not happen ;-)
* Contained are methods to use the keyboard (click, press, release) as is
* The keys are specified completely and only as string either litterally by their keynames
*/ public class Keys { private static String me = "KeyBoard: "; private static final int lvl = 3; private static void log(int level, String message, Object... args) { Debug.logx(level, me + message, args); } private static Keys keys = null; private static Device device = null; private Keys() { } public static void init() { if (keys == null) { keys = new Keys(); device = new Device(keys); log(3, "init"); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy