Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / keyboard shortcut

Author
Message
metamorpho
7
Years of Service
User Offline
Joined: 17th Oct 2016
Location: Planet Earth
Posted: 25th Jan 2017 11:09
Hello everybody !!

I need to do exit of the game by pressing ALT + F4

Please tell me the code.
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 25th Jan 2017 12:36 Edited at: 25th Jan 2017 13:15
if GetRawKeyState( 115 ) = 1 AND GetRawKeyState( 18 ) = 1
exit
endif

But it doesn't work like ALT+F4, on my pc it works only like F4+ALT...
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 25th Jan 2017 13:03
metamorpho
7
Years of Service
User Offline
Joined: 17th Oct 2016
Location: Planet Earth
Posted: 25th Jan 2017 15:21
Mobiius, thank you. But, code errors.
Your code does yield when pressed any of the two keys.


Alex_Peres, thank you.
But it doesn't work like ALT+F4, on my pc it works only like F4+ALT...

I need only by pressing ALT + F4
How to make ALT + F4 ????
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 25th Jan 2017 17:20
Call to John Paul...
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 25th Jan 2017 22:03 Edited at: 25th Jan 2017 22:09
alt right + f4 works but not with left alt , after left alt there is not an 1 if f4 is hold !?
there seems also a bug if alt right is pressed a 17 appear and after released it still have 1, key 17 is ctrl
i suggest using shift or crtl with F4 combination.



show all with =1


if you need the correct order of key pressed, check both crtl =1 and F4 =0 state is first key hold, if first key hold then check both return 1,
if both =0 then reset this first key hold flag.
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 26th Jan 2017 09:13
I've tried various combinations of getrawkeypressed/released/keystate/Lastkey etc... It seems all raw keyboard input stops if you hold alt, so current no way to detect alt+anything combo You could capture these in Tier2 with WM_SYSKEYUP/DOWN (I think).
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 26th Jan 2017 09:20 Edited at: 26th Jan 2017 09:23
It worked perfectly fine for me. I pressed and held the Alt key, then pressed F4 and it closed.
It sounds like your keyboard processor can't handle Alt + another key at once.


Ok, my code snippit above has changed, and now it doesn't work for me. Guess I was wrong. Weird.
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 26th Jan 2017 19:00
ALT+F4 - It is a MUST HAVE feature on every windows game.
damothegreat
User Banned
Posted: 26th Jan 2017 19:05
AGK remembers ALT been pressed (18)

and F4 pressed as (115)

But pressing ALT and then F4 - keeps scancode 18.

Because ALT and F4 is a windows O/S system scan key code, it might just not let us - cause its a Windows Controlled by Windows core API of the Windows O/S it just not able to remap it.

Same as any system controlled keymaps - Ctrl-Alt-Delete etc.. Windows APIs come first then applications.





Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 27th Jan 2017 10:21
Quote: "ALT+F4 - It is a MUST HAVE feature on every windows game."


i guess this is a wincows combination and windows send a close event to the app with focus.
AGK (Steam) V2017.01.09 : Windows 10 Pro 64 Bit : AMD (16.12.1) Radeon R7 265 : Mac mini OS Sierra (10.12.2)
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 27th Jan 2017 10:48
Quote: "ALT+F4 - It is a MUST HAVE feature on every windows game."

I disagree. It's a nice to have but people wont' not buy a game because it doesn't have Alt + F4 support.
A nice responsive user interface is more usable in my opinion.

Login to post a reply

Server time is: 2024-09-29 23:28:16
Your offset time is: 2024-09-29 23:28:16