fivem icon indicating copy to clipboard operation
fivem copied to clipboard

feat(extra-natives/five): add IS_GAME_WINDOW_FOCUSED

Open skyrossm opened this issue 3 years ago • 8 comments

Add a simple function for checking game window focus.

skyrossm avatar Jan 27 '22 20:01 skyrossm

... use cases? Impact assessment? Are we just supposed to take this and deal with it?

blattersturm avatar Jan 27 '22 20:01 blattersturm

Personal use case is going to be checking for focus to pause taskbars, while looking for a native similar some people had uses for "Away" statuses, and holding off on cursor manipulation if the game was not focused. I figured a native like this would be better than trying to hackily work around with cursor position, last input, etc.

skyrossm avatar Jan 27 '22 20:01 skyrossm

Flexible - sure. However, for example game pad input works fine if the game isn't focused.

I'm also worried about potential abuse cases for this 'simple' a call. People manage to abuse a lot of 'weird' state checks.

blattersturm avatar Jan 27 '22 21:01 blattersturm

About abuse, I have no idea but it would be handy especially for RP servers we can let players know, others are tab out or not, so they don't expect a response from them

MatinHQ avatar Jan 28 '22 07:01 MatinHQ

About abuse, I have no idea but it would be handy especially for RP servers we can let players know, others are tab out or not, so they don't expect a response from them

Potential abuse in this very example is RP servers banning/kicking users for being "tabbed out" for too long (via staff instruction or automatically) as some sort of AFK prevention or a naive "anti cheat" measure that gets bypassed by said cheats offering to patch this native to always return true. Seems silly? Remember that widely used "protections" are to ban/kick users for pressing the delete key or console key.

If ruining the user experience wasn't eventual outcome of most newly implemented neat features, the worry for abuse wouldn't be so significant.

jaymo1011 avatar Feb 06 '22 04:02 jaymo1011

In my opinion, worrying about abuse is silly. Why give up a feature that has multiple use cases just because some servers will kick / ban their players. A player can always find another server to play on.

Sampleeeee avatar Feb 10 '22 19:02 Sampleeeee

any update

regiments avatar Feb 14 '22 23:02 regiments

hello can you add this now

pachxl avatar Feb 21 '22 16:02 pachxl