Not working when a game window is focused #210

Open
Vahelnir opened this Issue Jun 3, 2016 · 18 comments

Comments

Projects
None yet
@Vahelnir

Vahelnir commented Jun 3, 2016

Hello everyone,
First, i'm sorry if there is any mistake.
Second, i'm also sorry if this was already asked but i didn't find it.
Actually, i don't really know if the issue is due to RobotJS, NodeJS or Windows but when i try to do for example 2 mouseClick() on a game window when it is focused, only the first click works.

EDIT: I'm a working with a vanilla nodejs script in cmd
Thank you for the help.

@octalmage

This comment has been minimized.

Show comment
Hide comment
@octalmage

octalmage Jun 4, 2016

Owner

Hi @Vavaballz, which version of RobotJS are you using? And which game?

Owner

octalmage commented Jun 4, 2016

Hi @Vavaballz, which version of RobotJS are you using? And which game?

@Vahelnir

This comment has been minimized.

Show comment
Hide comment
@Vahelnir

Vahelnir Jun 4, 2016

The last one, 0.4.4.
I tried with CS:GO and with Warframe.

Vahelnir commented Jun 4, 2016

The last one, 0.4.4.
I tried with CS:GO and with Warframe.

@demipixel

This comment has been minimized.

Show comment
Hide comment
@demipixel

demipixel Jul 13, 2016

TF2 here, same issue.

TF2 here, same issue.

@jdtzmn

This comment has been minimized.

Show comment
Hide comment
@jdtzmn

jdtzmn Aug 14, 2016

Minecraft here, same issue

OS: Mac 10.11.6
Game: Minecraft

I also tried using the "move-mouse-drag" branch, but to no avail... 😭
(I downloaded the 0.4.4 branch, then manually edited the files so that they were in sync with the 0.3.7 "move-mouse-drag" branch)

jdtzmn commented Aug 14, 2016

Minecraft here, same issue

OS: Mac 10.11.6
Game: Minecraft

I also tried using the "move-mouse-drag" branch, but to no avail... 😭
(I downloaded the 0.4.4 branch, then manually edited the files so that they were in sync with the 0.3.7 "move-mouse-drag" branch)

@octalmage

This comment has been minimized.

Show comment
Hide comment
@octalmage

octalmage Aug 14, 2016

Owner

This seems to be an issue for both Mac and Windows? Does the issue happen if the game isn't fullscreen?

Owner

octalmage commented Aug 14, 2016

This seems to be an issue for both Mac and Windows? Does the issue happen if the game isn't fullscreen?

@octalmage octalmage added the bug label Aug 14, 2016

@Vahelnir

This comment has been minimized.

Show comment
Hide comment
@Vahelnir

Vahelnir Aug 14, 2016

Yes, my first try with with warframe, warframe was fullscreen windowed

Yes, my first try with with warframe, warframe was fullscreen windowed

@CarpeNecopinum

This comment has been minimized.

Show comment
Hide comment
@CarpeNecopinum

CarpeNecopinum Aug 16, 2016

OS: Windows 7
Game: Lego StarWars Complete Saga
RobotJS version 4.40

Similar problem, keys get stuck once pressed, until I tab out of the game and back in. Except for the arrow keys which are released properly.

PS: Using DxWnd to force the game into windowed mode does not help.

CarpeNecopinum commented Aug 16, 2016

OS: Windows 7
Game: Lego StarWars Complete Saga
RobotJS version 4.40

Similar problem, keys get stuck once pressed, until I tab out of the game and back in. Except for the arrow keys which are released properly.

PS: Using DxWnd to force the game into windowed mode does not help.

@CarpeNecopinum

This comment has been minimized.

Show comment
Hide comment
@CarpeNecopinum

CarpeNecopinum Aug 17, 2016

This might in fact be fixed when #218 is fixed/executed.
I edited my application to use autoit (https://github.com/xhawk18/node-autoit) instead of robotjs and that makes it work flawlessly with Lego StarWars. That means it only works on windows for now.

Those who are testing under Windows should try using the autoit module and report their results....

This might in fact be fixed when #218 is fixed/executed.
I edited my application to use autoit (https://github.com/xhawk18/node-autoit) instead of robotjs and that makes it work flawlessly with Lego StarWars. That means it only works on windows for now.

Those who are testing under Windows should try using the autoit module and report their results....

@ahiddenwaffle

This comment has been minimized.

Show comment
Hide comment
@ahiddenwaffle

ahiddenwaffle Sep 26, 2016

Nope, running windows, even tried autoit, trying to run VisualBoyAdvance (Gameboy Emulator) Only first input registers.

Nope, running windows, even tried autoit, trying to run VisualBoyAdvance (Gameboy Emulator) Only first input registers.

@octalmage

This comment has been minimized.

Show comment
Hide comment
@octalmage

octalmage Sep 27, 2016

Owner

I will try to look into it this weekend, Windows isn't my first OS, so it's more difficult to look into this kind of stuff.

Owner

octalmage commented Sep 27, 2016

I will try to look into it this weekend, Windows isn't my first OS, so it's more difficult to look into this kind of stuff.

@octalmage

This comment has been minimized.

Show comment
Hide comment
@octalmage

octalmage Oct 9, 2016

Owner

@jdtzmn I spent some time testing this, and I wasn't able to replicate:

I haven't tested on Windows yet. Was this similar to what you were trying? Here's the code I used:

var robot = require('robotjs');

setInterval(function() {
    robot.mouseClick();
    console.log('Clicked.');
}, 2000);
Owner

octalmage commented Oct 9, 2016

@jdtzmn I spent some time testing this, and I wasn't able to replicate:

I haven't tested on Windows yet. Was this similar to what you were trying? Here's the code I used:

var robot = require('robotjs');

setInterval(function() {
    robot.mouseClick();
    console.log('Clicked.');
}, 2000);
@jdtzmn

This comment has been minimized.

Show comment
Hide comment
@jdtzmn

jdtzmn Oct 11, 2016

Oh... thought this was about moving the mouse, not clicking... 😜

jdtzmn commented Oct 11, 2016

Oh... thought this was about moving the mouse, not clicking... 😜

@giacomocerquone

This comment has been minimized.

Show comment
Hide comment
@giacomocerquone

giacomocerquone Nov 30, 2016

So here another problem that I've encountered too on windows 10, it could be slightly different but still can be originated from the same malfunctioning code.
It's not only games, to test this I pressed f11 on chrome and I can't write anymore, but it seems that only letters keys don't work anymore, in fact if I press f11 again chrome get out from fullscreen mode and everything return to work normally.

UPDATE:
I noticed one thing (this may be a problem that occurs only to me). I am a js developer and when I work on the console (and start a js script with node to say) it happens sometime that I have to wakeup powershell (same thing happen with the cmd) with some sort of input (it can be the right click of the mouse or the return key) and then it starts the execution that had to start before... it's like it goes in stand-by.
I said this because this is exactly what happens when I play on full-screen, I come back on powershell and I've to wake it up with some input.

giacomocerquone commented Nov 30, 2016

So here another problem that I've encountered too on windows 10, it could be slightly different but still can be originated from the same malfunctioning code.
It's not only games, to test this I pressed f11 on chrome and I can't write anymore, but it seems that only letters keys don't work anymore, in fact if I press f11 again chrome get out from fullscreen mode and everything return to work normally.

UPDATE:
I noticed one thing (this may be a problem that occurs only to me). I am a js developer and when I work on the console (and start a js script with node to say) it happens sometime that I have to wakeup powershell (same thing happen with the cmd) with some sort of input (it can be the right click of the mouse or the return key) and then it starts the execution that had to start before... it's like it goes in stand-by.
I said this because this is exactly what happens when I play on full-screen, I come back on powershell and I've to wake it up with some input.

@DJLennard

This comment has been minimized.

Show comment
Hide comment
@DJLennard

DJLennard May 29, 2017

Is there a solution yet?

Is there a solution yet?

@vsdmoraes

This comment has been minimized.

Show comment
Hide comment
@vsdmoraes

vsdmoraes Apr 14, 2018

Any update on this issue?

Any update on this issue?

@zapk

This comment has been minimized.

Show comment
Hide comment
@zapk

zapk May 26, 2018

Happening to me, mouse doesn't work at all in CS:GO.

zapk commented May 26, 2018

Happening to me, mouse doesn't work at all in CS:GO.

@GenericPirate

This comment has been minimized.

Show comment
Hide comment
@GenericPirate

GenericPirate May 26, 2018

Yeah here too, whats the cause for it? Want to use it to run automated tests on game builds ...

Yeah here too, whats the cause for it? Want to use it to run automated tests on game builds ...

@zapk

This comment has been minimized.

Show comment
Hide comment
@zapk

zapk May 26, 2018

Does anyone know any alternatives that work?

zapk commented May 26, 2018

Does anyone know any alternatives that work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment