Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
0 registered members (), 17,416 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Trapping extended key? #224282
08/29/08 13:18
08/29/08 13:18
Joined: May 2008
Posts: 91
Eugene, OR. USA
ATOMIX Offline OP
Junior Member
ATOMIX  Offline OP
Junior Member

Joined: May 2008
Posts: 91
Eugene, OR. USA
I use the following command to lock a keystroke to a function
Code:
on_2 = freeCamera;

How do I trap an extended keystroke combination like ctrl-a or alt-c? I know how to check for it but can't see how to use it like above.
Any help is greatly appreciated.


ATOMIX Productions
ATOMIX Group LLC
http://theatomizer.com
A7 Pro 7.50
Re: Trapping extended key? [Re: ATOMIX] #224314
08/29/08 15:21
08/29/08 15:21
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
function that_shall_be_run_when_alt_and_c_is_pressed ()
{
...
}

function that_shall_be_run_when_only_c_is_pressed ()
{
...
}
function that_shall_be_run_when_c_is_pressed ()
{
if (key_alt) that_shall_be_run_when_alt_and_c_is_pressed ();
else function that_shall_be_run_when_only_c_is_pressed ();
}

...

on_c = that_shall_be_run_when_c_is_pressed;

wink

Re: Trapping extended key? [Re: Lukas] #224504
08/30/08 15:11
08/30/08 15:11
Joined: May 2008
Posts: 91
Eugene, OR. USA
ATOMIX Offline OP
Junior Member
ATOMIX  Offline OP
Junior Member

Joined: May 2008
Posts: 91
Eugene, OR. USA
Lukas: Thanks for responding! I was confused about how on_alt and on_ctrl works. I would have done it like.
Initialize it.
Code:
on_alt = altKeyFunction;


Then the function.
Code:
function altKeyFunction()
{
   if (key_c)
      ...
   if (key_h)
      ...
}

But this is different than your approach. Will it work?


ATOMIX Productions
ATOMIX Group LLC
http://theatomizer.com
A7 Pro 7.50
Re: Trapping extended key? [Re: ATOMIX] #224508
08/30/08 15:49
08/30/08 15:49
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
Hmm, yes, but on_c will also be executed when prssing alt+c. Also, usually you have to hold alt first and then press c for executing the function, yours also allowes first pressing c and then pressing alt.

Re: Trapping extended key? [Re: Lukas] #225643
09/05/08 14:37
09/05/08 14:37
Joined: May 2008
Posts: 91
Eugene, OR. USA
ATOMIX Offline OP
Junior Member
ATOMIX  Offline OP
Junior Member

Joined: May 2008
Posts: 91
Eugene, OR. USA
Thanks for the input! It's Amazing how a little change can really change everything.


ATOMIX Productions
ATOMIX Group LLC
http://theatomizer.com
A7 Pro 7.50

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1