Reading input (keyboard, mouse) on an unfocused window?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Reading input (keyboard, mouse) on an unfocused window?
Well as the title says I'm wondering if it's at all possible within love to read keystrokes, mouse inputs when the game is unfocused (foreground)? isDown, keypressed and keyreleased seems to produce nothing when the window isn't focused.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Reading input (keyboard, mouse) on an unfocused window?
love (and SDL, the library love uses for cross-platform input) don't have that capability. What sort of thing would you use it for?
Re: Reading input (keyboard, mouse) on an unfocused window?
Ah, I see. I imagine it being platform dependent. In this case I would use it to create a few graphical twitch/stream tools that are ran in the background, and needs to read the keyboard/mouse/gamepad, outside of Löve2D's scope I'm sure but I thought it was worth a shot to ask.
- slime
- Solid Snayke
- Posts: 3166
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: Reading input (keyboard, mouse) on an unfocused window?
You can enable joystick/gamepad input events while the window isn't in focus, at least: https://bitbucket.org/rude/love/issues/ ... ndow-focus
-
- Citizen
- Posts: 86
- Joined: Mon Jul 17, 2017 2:07 pm
Re: Reading input (keyboard, mouse) on an unfocused window?
can i add, if it's useful, that i have the same issue everywhere, it's the same on java for example
it's a security issue, it stops you from key logging, in the case of java, you need an OS specific hook, to do that keylogging
it's a security issue, it stops you from key logging, in the case of java, you need an OS specific hook, to do that keylogging
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Reading input (keyboard, mouse) on an unfocused window?
You can also use the FFI to achieve the same thing in löve, probably; it wouldn't be a cross-platform solution though.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Bing [Bot] and 3 guests