[Newbies] java Robot 怎么使用 类似 windows + D 显示桌面
Tofloor
poster avatar
95******17@qq.com
deepin
2023-01-12 18:23
Author

if(isWindows){ // window
robot.keyPress(KeyEvent.VK_WINDOWS);
if(keyCode==68){ // window + d
robot.keyPress(keyCode);
robot.keyRelease(keyCode);
}
robot.keyRelease(KeyEvent.VK_WINDOWS);
}else { // linux
// deepin
// robot.keyPress(KeyEvent.VK_WINDOWS);
// if (keyCode == 68) { // window + d
// robot.keyPress(keyCode);
// robot.keyRelease(keyCode);
// }
// robot.keyRelease(KeyEvent.VK_WINDOWS);
log.info("windows+d---------------------------------");
// gnome Ctrl + Alt + d
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(KeyEvent.VK_ALT);
if (keyCode == 68) {
robot.keyPress(keyCode);
robot.keyRelease(keyCode);
}
robot.keyRelease(KeyEvent.VK_ALT);
robot.keyRelease(KeyEvent.VK_CONTROL);
}

deepin 怎么实现Windows + D

Reply Favorite View the author
All Replies
晚秋(lateautumn)
Moderator
2023-01-12 18:48
#1

太高深了,坛神们快来看看吧joy

Reply View the author
Lwh2008-Equinox
deepin
2023-01-12 18:58
#2

dde不是快捷键不是有这个吗?

基本Windows上面快捷键dde都复刻了

Reply View the author
95******17@qq.com
deepin
2023-01-12 19:03
#3
Lwh2008-Equinox

dde不是快捷键不是有这个吗?

基本Windows上面快捷键dde都复刻了

dde 是用键盘吗?不是很熟悉,我要做的是app 遥控 没有键盘。

Reply View the author
Lwh2008-Equinox
deepin
2023-01-12 19:22
#4
95******17@qq.com

dde 是用键盘吗?不是很熟悉,我要做的是app 遥控 没有键盘。

类似于远程桌面的快捷键或者是一键式的快捷键啊。。。

这个得要找懂java的了

我不是学java的joy

Reply View the author
DebuggerX
deepin
2023-01-13 19:35
#5

deepin下其实不用这么麻烦的。

只要执行

/usr/lib/deepin-daemon/desktop-toggle

就可以了。

参考:

https://github.com/linuxdeepin/dde-dock/blob/92bb6933eb44df99b859979e85f3b81be1219c70/plugins/show-desktop/showdesktopplugin.cpp#L113

Reply View the author
95******17@qq.com
deepin
2023-01-13 19:38
#6
DebuggerX

deepin下其实不用这么麻烦的。

只要执行

/usr/lib/deepin-daemon/desktop-toggle

就可以了。

参考:

https://github.com/linuxdeepin/dde-dock/blob/92bb6933eb44df99b859979e85f3b81be1219c70/plugins/show-desktop/showdesktopplugin.cpp#L113

我用shell 弄出来了

Reply View the author
95******17@qq.com
deepin
2023-01-13 21:43
#7
DebuggerX

deepin下其实不用这么麻烦的。

只要执行

/usr/lib/deepin-daemon/desktop-toggle

就可以了。

参考:

https://github.com/linuxdeepin/dde-dock/blob/92bb6933eb44df99b859979e85f3b81be1219c70/plugins/show-desktop/showdesktopplugin.cpp#L113

shell 执行 /usr/lib/deepin-daemon/desktop-toggle 也行

Reply View the author