Author Topic: Shortcuts don't trigger command - Elite Dangerous  (Read 10055 times)

WildBill24

  • Newbie
  • *
  • Posts: 15
Shortcuts don't trigger command - Elite Dangerous
« on: June 05, 2016, 03:48:03 AM »
Hi,
odd behaviour here with shortcuts. I have set up a comprehensive profile for Elite that uses a structure whereby a core Command (lets call it Command_A) is designed to respond to keyboard or joystick input only, and then I can call Command_A from a separate speech rec command (lets call that Command_SR). I use a global variable to denote if I've called Command_A from speech or not.

When I call the Command_A from Command_SR it all works fine.
When I press the shortcut key, the key works in Elite but fails to trigger Command_A. I therefore assume that the key press is intercepted by Elite first so VA can't see it.

Now before you ask, the reason for all this nonsense is because when I trapped the shortcut key presses in VA, I couldn't enter text into the Elite text fields for maps etc, so my logic was to let the key press pass through VA to Elite.

Whats odd is that about 10% of the time it actually works as intended. Anyone got any ideas on how to force this?
Attached is a sample command.
Thanks.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #1 on: June 05, 2016, 08:08:39 AM »
As a side note, you don't need a global variable to see how the command was called. The value of "{CMDACTION}" is inherited by any command in an "Execute Another Command" chain:
Code: [Select]
Begin Text Compare : [{CMDACTION}] Equals 'Spoken'
End Condition


I've proposed this workaround before, though in another context:

Code: [Select]
(when i press 1)
Begin Integer Compare : [Quantity] Has Been Set
    Set integer [Quantity] value to the converted value of {EXP: {INT:Quantity} * 10 + 1}
Else
    Press 1 key and hold for 0,06 seconds and release
End Condition

And set the keypress to "Do not allow key to be passed through".

Alternatively, to allow long press/holding keys:
Code: [Select]
(when i press 1)
Begin Integer Compare : [Quantity] Has Been Set
    Set integer [Quantity] value to the converted value of {EXP: {INT:Quantity} * 10 + 1}
Else
    Press down 1 key
    Start Loop While : [{STATE_KEYSTATE:1}] Equals '1'
    End Loop
    Release 1 key
End Condition

I don't know exactly which actions you're triggering on keypress, but if the keypresses to VoiceAttack aren't intercepted by Elite(as they are the other way around), it's probably more reliable to do it this way.

WildBill24

  • Newbie
  • *
  • Posts: 15
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #2 on: June 05, 2016, 08:33:27 AM »
Thanks for that, I'd just figured out using {CMDACTION} after I wrote all the commands. Would have been more elegant.
Still, I remain with the issue that I have key presses that are intercepted by Elite but not by VA; these are standard QWERTY keys but I don't want to block them as I need them for text field input.
Appreciate your help though.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #3 on: June 05, 2016, 01:54:57 PM »
Have you tried a different key other than, '1'?  That would be a good test to find out if something else is hooking that key.

WildBill24

  • Newbie
  • *
  • Posts: 15
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #4 on: June 05, 2016, 03:59:43 PM »
Yes it ts all keys. I have done extensive testing using logs. Commands do not see the keystrokes.

WildBill24

  • Newbie
  • *
  • Posts: 15
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #5 on: June 05, 2016, 06:53:31 PM »
I should add that I'm using Windows 10 Home.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #6 on: June 05, 2016, 09:27:16 PM »
Do you have any other third-party software running?  Synergy?  TeamViewer or anything else that may be hooking the keyboard?

WildBill24

  • Newbie
  • *
  • Posts: 15
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #7 on: June 06, 2016, 04:27:54 AM »
I am not aware of any, unless my anti-virus is getting in the way.
I'll do some more tests tonight.
Thanks for all you assistance guys.

WildBill24

  • Newbie
  • *
  • Posts: 15
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #8 on: June 06, 2016, 07:22:47 AM »
Nope, no luck.
I have no problems with the speech part, but I guess I'll have to leave the key recognition; it just doesn't work reliably on Elite.
I've played with process window targets, key traps, the lot. So I guess I'll have to leave use of keyboard with standard Elite responses and limit VA to spoken interaction.

WildBill24

  • Newbie
  • *
  • Posts: 15
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #9 on: June 08, 2016, 06:49:15 AM »
So on the off chance any of you have the same issue, I think I've fixed it. One (or both) of two things:

1. Clean up my code; minimising nested conditional statements and using the Exit Command feature of End conditions; rewrite to reduce the use of 'global' variables. At the very least this will have speeded up VoiceAttack which was starting to get sluggish to load the profile.

2. Install Beta v1.5.8.24
Set to 'Always On Top'

Now it all works 95% of the time so that's a major improvement.
I'll post my full Elite Dangerous profile in a while.

WildBill24

  • Newbie
  • *
  • Posts: 15
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #10 on: June 10, 2016, 10:00:05 PM »
FYI I've posted my Elite profile in case anyone is interested.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
Re: Shortcuts don't trigger command - Elite Dangerous
« Reply #11 on: June 10, 2016, 11:13:32 PM »
Thanks, WildBill.  I'm sure this will come in handy :)