mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[remote-driver] add SmoothRobot#doublePressKeyAndHold
GitOrigin-RevId: a3180391f699c9d2cd325ae8e731d957a9cb920b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
54a00a6fe7
commit
b5ecef22bd
@@ -42,9 +42,7 @@ class RemoteKeyboard(private val robot: Robot) {
|
||||
|
||||
fun doublePressing(key: Int, doWhilePress: RemoteKeyboard.() -> Unit) {
|
||||
try {
|
||||
robot.pressKey(key)
|
||||
robot.releaseKey(key)
|
||||
robot.pressKey(key)
|
||||
robot.doublePressKeyAndHold(key)
|
||||
this.doWhilePress()
|
||||
} finally {
|
||||
robot.releaseKey(key)
|
||||
|
||||
@@ -26,6 +26,7 @@ interface Robot {
|
||||
fun pressMouse(point: Point, mouseButton: RemoteMouseButton)
|
||||
fun pressKey(p0: Int)
|
||||
fun doubleKey(p0: Int)
|
||||
fun doublePressKeyAndHold(key: Int)
|
||||
fun releaseKey(p0: Int)
|
||||
fun type(char: Char)
|
||||
fun enterText(text: String)
|
||||
|
||||
@@ -261,6 +261,13 @@ internal class SmoothRobot : Robot {
|
||||
fastRobot.keyRelease(p0)
|
||||
}
|
||||
|
||||
fun doublePressKeyAndHold(key: Int) {
|
||||
fastRobot.keyPress(key)
|
||||
fastRobot.keyRelease(key)
|
||||
Thread.sleep(10)
|
||||
fastRobot.keyPress(key)
|
||||
}
|
||||
|
||||
override fun settings(): Settings = basicRobot.settings()
|
||||
|
||||
override fun enterText(text: String) {
|
||||
|
||||
Reference in New Issue
Block a user