How do I assign right shift?

Issues, Bugs and Questions regarding creation and use of controls

How do I assign right shift?

Postby lifeofbrian » 23. Dec 2014, 19:27

I see no option, only shift by itself?
lifeofbrian
 
Posts: 3
Joined: 21. Dec 2014, 18:11

Re: How do I assign right shift?

Postby lifeofbrian » 23. Dec 2014, 23:25

OK, I managed to get right shift and right alt working just by adding R in front of the function command, but it doesn't work for right control. :cry:
lifeofbrian
 
Posts: 3
Joined: 21. Dec 2014, 18:11

Re: How do I assign right shift?

Postby TomCom03 » 10. Jan 2015, 15:28

same here for RCtrl - Commands.
Any Solutions yet?
TomCom03
 
Posts: 1
Joined: 10. Jan 2015, 15:26

Re: How do I assign right shift?

Postby Addihash » 2. Mar 2015, 12:11

Are you using the macro recorder or the shortcut function? And have you tried to use the other one?
One solution that I know for this problem is to use a Plugin which implements a .dll. In that .dll you can use SendInput() and use scancodes to define the input.
But that is a very expensive solution and requires some programming skills. However we will show in the future how to do that (if this really is the only solution).
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35

Re: How do I assign right shift?

Postby Andre » 26. Jul 2015, 15:24

Hello,
using both the macro recorder and the shortcut function it's not possible to send RCTRL modifier.
It's badly for complex flight simulators.
Are you going to fix the issue or give us some workaround solution, guys?

Kind regards,
Andre
Andre
 
Posts: 21
Joined: 26. Jul 2015, 14:51

Re: How do I assign right shift?

Postby Addihash » 28. Jul 2015, 09:50

The only workaround now is to create a plugin and use a custom DLL.
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35

Re: How do I assign right shift?

Postby Andre » 28. Jul 2015, 12:10

Hi Addihash,
OK, I'm going to do that.
Could you please give me an example you were talking about?
Andre
 
Posts: 21
Joined: 26. Jul 2015, 14:51

Re: How do I assign right shift?

Postby Addihash » 30. Jul 2015, 10:16

This example is taken from the Omsi Grid and shows how to send input via scankeys in C++.
First you need to create a INPUT variable. I prefer using two arrays, one for pressing the key and one for releasing.

First we initialize the arrays and then we manually assign the scancodes of the keys we want to press.
To find these you need a google search and some trial and error, but it is important that you don't use the VK_CODES because they will not work.
Code: Select all
    INPUT inp[21];
    INPUT inpr[21]

    /* initialize INPUT arrays */
    for(int i = 0; i<21; i++){
        inp[i].type = INPUT_KEYBOARD;
        inp[i].ki.time = 0;
        inp[i].ki.dwExtraInfo = 0;
        inp[i].ki.wVk = 0;

        inpr[i].type = INPUT_KEYBOARD;
        inpr[i].ki.time = 0;
        inpr[i].ki.dwExtraInfo = 0;
        inpr[i].ki.wVk = 0;
        if(i==0 || i==3){
            inp[i].ki.dwFlags = KEYEVENTF_EXTENDEDKEY | KEYEVENTF_SCANCODE;
            inpr[i].ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_EXTENDEDKEY | KEYEVENTF_SCANCODE;
        }
        else{
            inp[i].ki.dwFlags = KEYEVENTF_SCANCODE;
            inpr[i].ki.dwFlags = KEYEVENTF_KEYUP | KEYEVENTF_SCANCODE;
        }
    }
    /* Configure keys to release and press */
    inpr[0].ki.wScan = inp[0].ki.wScan = 0x1C;      // NumENTER
    inpr[1].ki.wScan = inp[1].ki.wScan = 0x1D;      // LCTRL
    inpr[2].ki.wScan = inp[2].ki.wScan = 0x2A;      // LSHIFT
    inpr[3].ki.wScan = inp[3].ki.wScan = 0x35;      // NumDIV
    inpr[4].ki.wScan = inp[4].ki.wScan = 0x37;      // NumMUL
    inpr[5].ki.wScan = inp[5].ki.wScan = 0x53;      // NumDEC
    inpr[6].ki.wScan = inp[6].ki.wScan = 0x07;      // 06
    inpr[7].ki.wScan = inp[7].ki.wScan = 0x08;      // 07
    inpr[8].ki.wScan = inp[8].ki.wScan = 0x09;      // 08
    inpr[9].ki.wScan = inp[9].ki.wScan = 0x0A;      // 09
    inpr[10].ki.wScan = inp[10].ki.wScan = 0x52;    // Num0
    inpr[11].ki.wScan = inp[11].ki.wScan = 0x4F;    // Num1
    inpr[12].ki.wScan = inp[12].ki.wScan = 0x50;    // Num2
    inpr[13].ki.wScan = inp[13].ki.wScan = 0x51;    // Num3
    inpr[14].ki.wScan = inp[14].ki.wScan = 0x4B;    // Num4
    inpr[15].ki.wScan = inp[15].ki.wScan = 0x4C;    // Num5
    inpr[16].ki.wScan = inp[16].ki.wScan = 0x4D;    // Num6
    inpr[17].ki.wScan = inp[17].ki.wScan = 0x47;    // Num7
    inpr[18].ki.wScan = inp[18].ki.wScan = 0x48;    // Num8
    inpr[19].ki.wScan = inp[19].ki.wScan = 0x49;    // Num9
    inpr[20].ki.wScan = inp[20].ki.wScan = 0x14;    // T


Next we fire some keys!
Here we press LCTRL and NumpadEnter which is also not possible through power-grid itself.
Code: Select all
    SendInput(1,&inp[1],sizeof(INPUT));      //Press LCTRL
    Sleep(50);
    SendInput(1,&inp[0], sizeof(INPUT));     //Press NumENTER
    Sleep(50);
    SendInput(1,&inpr[0], sizeof(INPUT));    //Release NumENTER
    Sleep(50);
    SendInput(1,&inpr[1],sizeof(INPUT));     //Release LCTRL


And thats it. For Information on how to create DLL plugins please read the documentation.
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35

Re: How do I assign right shift?

Postby Andre » 30. Jul 2015, 10:36

Thanks a lot Addihash.
Andre
 
Posts: 21
Joined: 26. Jul 2015, 14:51

Re: How do I assign right shift?

Postby XT-ara » 22. Feb 2016, 02:26

Addihash,
where can we find the documentation? I am in the same situation and want to explore this route before I abandon my project.
XT-ara
 
Posts: 2
Joined: 10. Feb 2016, 00:36
Location: United States

Next

Return to Controls

Who is online

Users browsing this forum: No registered users and 1 guest