P.I. Engineering User Forum

Product Support, Technical Questions and Answers, and Examples for P.I. Engineering Products

You are not logged in.

#1 2016-07-21 04:52:03

jh-mobile
Member
Registered: 2016-02-29
Posts: 3

Combined HID-Codes do not work

Hello User Forum,

i try to get combined HID-Codes to work. A single HID-Code works without Problems.
In the actual case i need "CTRL+F12".
If i type in directly from the keyboard it works.
If i use the attached script code nothing happens.

Script-1
--------
'<send_LeftControl-down>
MW3.sendReflectorHidCode(MyDevice,"224:1")
'</send_LeftControl-down>
'<send_F12-down>
MW3.sendReflectorHidCode(MyDevice,"069:1")
'</send_F12-down>
'<Delay[500]>
MW3.insertDelay(500)
'</Delay[500]>
'<send_F12-up>
MW3.sendReflectorHidCode(MyDevice,"069:0")
'</send_F12-up>
'<send_LeftControl-up>
MW3.sendReflectorHidCode(MyDevice,"224:0")
'</send_LeftControl-up>


Script-2
---------
'<send_LeftControl+F12>
MW3.sendReflectorHidCode(MyDevice,"224:1,069:1,069:0,224:0")
'</send_LeftControl+F12>

Additional Question:
In your advanced programming help i miss the codes for all the modifier keys !
Do you have an actual list ?
I only have found the codes in "HID Usage Tables; 10/28/2004; Version 1.12; hidcomments@usb.org"


Kind regards
jh-mobile

Offline

#2 2016-07-25 15:33:24

PIE Amber
Technical Software Developer
From: Williamston, MI
Registered: 2016-01-21
Posts: 196
Website

Re: Combined HID-Codes do not work

Hi there,

Are you using reflector commands for a reason? I guess, what I mean to ask is, is there a reason hardware mode keystrokes programmed normally won't work for your needs? "Reflector" is a very niche requirement so I want to make sure we're not leading you down the wrong path.

Also, the codes you are using are correct, so I do not expect that to be the issue. I just tested it out and you're correct, HID codes do not combine. Whether that's a bug or a symptom of the difference between reflector vs. other types of programming, I'm not sure. I will check in with our engineers.

If at all possible, I recommend using hardware mode keystrokes.


Amber from P.I. Engineering

Offline

#3 2016-07-26 07:58:47

jh-mobile
Member
Registered: 2016-02-29
Posts: 3

Re: Combined HID-Codes do not work

Hello Technical Support,

thank you for your quick answer.

I have to use "Reflector-Code" because "Scan-Code" does not work properly.
Sometimes Scan-Code works and sometimes not (i don't know why). 
In the actual case i use it to start and stop a screen-recorder (Bandicam).


====== This code does not work =============

If State 'Pressed          [MWTAG10]
            '<send_Start-Play>
            MW3.sendScanCode("70:1")
            '</send_Start-Play>
            '<send_Start-Play>
            MW3.sendScanCode("70:0")
            '</send_Start-Play>
Else 'Released             [MWTAG11]
            '<send_Pause-Play>
            MW3.sendScanCode("197:1")
            '</send_Pause-Play>
            '<send_Pause-Play>
            MW3.sendScanCode("197:0")
            '</send_Pause-Play>
End If 'Press-Release      [/MWTAG10/MWTAG11]



====== This code does works  =============

If State 'Pressed          [MWTAG10]
            '<send_Start-Play>
            MW3.sendReflectorHidCode(MyDevice,"071:1")
            '</send_Start-Play>
            '<send_Start-Play>
            MW3.sendReflectorHidCode(MyDevice,"071:0")
            '</send_Start-Play>
Else 'Released             [MWTAG11]
            '<send_Pause-Play>
            MW3.sendReflectorHidCode(MyDevice,"072:1")
            '</send_Pause-Play>
            '<send_Pause-Play>
            MW3.sendReflectorHidCode(MyDevice,"072:0")
            '</send_Pause-Play>
End If 'Press-Release      [/MWTAG10/MWTAG11]


Many thanks in advance for your help.


Kind regards
jh-mobile

Offline

#4 2016-07-26 14:53:49

PIE Amber
Technical Software Developer
From: Williamston, MI
Registered: 2016-01-21
Posts: 196
Website

Re: Combined HID-Codes do not work

I do wonder if hardware mode would work better for you (sometimes "software mode" keystrokes don't work but "hardware mode" will). That said, here is what I got from engineering. Looks like we need to update our documentation:


"Below is how it should be.  The hid code reflector (keyboard reflector) command wants the state of any modifiers EVERY TIME it is sent, the modifiers are special like that. The help file is not as clear as it should be."

Case 1001 'Button 001
If State 'Pressed [MWTAG10]
'<send_LeftControl+F12>
MW3.sendReflectorHidCode(MyDevice,"224:1,069:1")
'</send_LeftControl+F12>
'<Delay[500]>
MW3.insertDelay(500)
'</Delay[500]>
'<send_F12-up>
MW3.sendReflectorHidCode(MyDevice,"224:1,069:0")
'</send_F12-up>
'<send_LeftControl-up>
MW3.sendReflectorHidCode(MyDevice,"224:0")
'</send_LeftControl-up>
Else 'Released [MWTAG11]
End If 'Press-Release [/MWTAG10/MWTAG11]


Amber from P.I. Engineering

Offline

#5 2016-07-27 10:34:46

jh-mobile
Member
Registered: 2016-02-29
Posts: 3

Re: Combined HID-Codes do not work

Hello Technical Support,

thanks for your help -> Now it works :)


Kind regards
jh-mobile

Offline

Board footer

Powered by FluxBB