Home   Help Search Login Register  

Author Topic: sendkey/macro  (Read 1506 times)

0 Members and 1 Guest are viewing this topic.

Offline alimag

  • Contributing Member
  • **
  • I'm a llama!
sendkey/macro
« on: 13 Oct 2009, 02:34:45 »
Hi,

Is there a way to simulate key presses by script?

You know like a macro or sendKey function (that I did not found).

Something in a script like:

sendKey {32, 45};

or

[32, 45] execVM "sendKey.sqf";

would simulate pressing the corresponding keys...

Thanks in advance

Cheers
« Last Edit: 13 Oct 2009, 02:36:50 by alimag »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: sendkey/macro
« Reply #1 on: 14 Oct 2009, 01:38:21 »
Do you mean to trigger ArmA default behaviour for that key? If so, no that I know, and also consider that many users have all the keys redefined.

Offline alimag

  • Contributing Member
  • **
  • I'm a llama!
Re: sendkey/macro
« Reply #2 on: 14 Oct 2009, 05:21:04 »
Hi Mandoble,

Thanks for answering.

It's exactly what I had in mind.

In fact I was thinking about making something more visual like a menu or dialog for players that have problems with the default squad management system. But I did'nt want to script all the corresponding behaviours.

For example, I've found that the command Return to formation is connected to a constant CMD_JOIN that corresponds to the value 9. But that's where the trail ends. I suspect that those commands are hardcoded somewhere in the executable so short of reverse enginering there is no way to access them.

So I had to think of some other way. But as you say, if the keyboard is remapped...I did not think of that one.

I'm not sure it's worthed to rescript everything...

Thanks anyway. I appreciate that you took the time to answer.

Cheers