Jump to content
The simFlight Network Forums

CTRL+ALT value?


Recommended Posts

Hello,

I can use with LUA value 11 for CTRL+SHIFT

But what is the value for CTRL + ALT?

 

example:

-- CTRL + SHIFT + F16
    ext.sendkeys(myHandle, 127,11,4)
    

What should I insert if I want the keycombination CTRL + ALT + F16?

 

many thanks!

Link to comment
Share on other sites

1 hour ago, guenseli said:

I can use with LUA value 11 for CTRL+SHIFT

But what is the value for CTRL + ALT?

 

example:

-- CTRL + SHIFT + F16
    ext.sendkeys(myHandle, 127,11,4)
    

What should I insert if I want the keycombination CTRL + ALT + F16?

In ext.sendKeys, 11 is Shift+Ctrl+Tab, not just Shift+Control. As documented one 19 in the Lua library PDF, along with the keycodes! It also lists the value to add for ALT.

What is the 4 in the 4th parameter position for?  It isn't a listed keycode. In the list of Windows Key Codes it says:

VK_MBUTTON
0x04
Middle mouse button (three-button mouse)

but I doubt that works with the basic SendMessage WM_KEYDOWN,  WM_KEYUP  method used in sendkeys. Interesting to try perhaps, though. The Windows documented list is extended since I last looked at it.

Pete

 

 

 

Link to comment
Share on other sites

In my LUA script the above code is working very well.

And "11" does send CTRL+SHIFT , without TAB … tested it.

 

The page 19 in the LUA library does not tell me anything about value 11 … or have I missed it? I have it from an other scripz

Quote

The shifts value is a combination (add them) of the following values, as needed: 
1 Shift

2 Control

4 Alt

8 Tab

16 Alt (take care with this one—it invokes the Menu) 

 

Quote

 0 Null (+ Alt, Shift etc alone)  

8 Backspace  

9 Tab  

12 NumPad 5 (NumLock Off)  

13 Enter  

16 Shift  

17 Control  

 

So, how is CTRL+ALT possible?

Link to comment
Share on other sites

2 hours ago, guenseli said:

The page 19 in the LUA library does not tell me anything about value 11

11 is used in FSUIPC itslef, where "8" meant "key by itself". Rather a waste of a bit -- the flags derived from original Windows message codes, though that one's an oddity. I think it dates back to something in an early version of FS and therefore FSUIPC.

Not sure why TAB wasn't generated. I'll take a look.

2 hours ago, guenseli said:

So, how is CTRL+ALT possible?

Oh dear. 😞

You didn't read your own quote?

"The shifts value is a combination (add them) "

Shift and Control = 1 + 2 -> 3 (you added the old 8 in from FSUIPC practice).

Surely it is logical then that 2 + 4 = 6 means Ctrl + Alt? they are BITS -- individual bits for each shift! Always have been, in FSUIPC, WideFS and Lua!

Your second "quote" is from the key code list, not the shift list!

Pete

 

Link to comment
Share on other sites

BTW if TAB is requested is has to be sent separately in any case, as there's no "shift" in Windows for TAB.  So it sends "KEYDOWN for TAB then KEYDOWN for the main key + shift bits, then the KEY UPs.   Unless the destination program is one that can process multiple key presses like that, then the TAB would probably be ignored. FSUIPC processes them, but that's the only double press it accepts.

Pete

 

Link to comment
Share on other sites

Perhaps you were trying to ask (unsucceessfully obviously. asking "how possible" instead of "which bit"), WHICH of the bits labelled ALT you should use?

That's actually quite interesting. I hadn't noticed there were two entries for ALT. It looks like a documentation error -- a mish mash from FSUIPC key lists. 

If this was your original question, why not just point out the ambiguity? It would have been much quicker!

Pete

 

Link to comment
Share on other sites

Okay. The documentation is wrong. I'll revise it. Strange it has never been pointed out before.

Here's what the code accepts:

1     Shift
2     Control
4     Tab
8     -- (not used)
16    Alt
32    Left Win Key
64    Apps Key

But I'll be testing this as i'm not sure about a couple of things.

Pete

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.