Sana Posted May 8, 2019 Share Posted May 8, 2019 (edited) I have this snippet of code that will move the mouse offscreen. It works fine. See the code below: private void antiBanMoveMouseOffscreen() { int myMouseOffscreenAverage = random(learningData.MOUSE_OFFSCREEN_START, learningData.MOUSE_OFFSCREEN_END); paint.state("[Anti-Ban] Moving mouse offscreen for " + myMouseOffscreenAverage + "ms to simulate AFK..."); getMouse().moveOutsideScreen(); Sleep.sleepUntil(() -> false, myMouseOffscreenAverage); paint.state("[Anti-Ban] Complete!"); } I want to unfocus the OSBuddy client after I do this. I see a method to check if the client is focused: getClient().hasFocus() But I don't see an equivalent "getClient().setFocus()". Anyone know how to do this in OSBot? Thanks! Edited May 8, 2019 by Lansana Camara 1 Quote Link to comment Share on other sites More sharing options...
liverare Posted May 8, 2019 Share Posted May 8, 2019 There's an array of frames in the JFrame class: JFrame.getFrames()[0].setFocus(false) 1 Quote Link to comment Share on other sites More sharing options...
asdttt Posted May 9, 2019 Share Posted May 9, 2019 Keyboard focus is spoofed Quote Link to comment Share on other sites More sharing options...
adelmas Posted February 18, 2022 Share Posted February 18, 2022 (edited) Does anyone else know how to do this? I tried what liverare suggested and it didn't work at all. It brought up a widget debugging window. edit: nvm, figured it out Edited February 18, 2022 by adelmas Quote Link to comment Share on other sites More sharing options...