SendKeyboard (System) send combined keys like Alt+F9


#1

Hi , how could i send combined keys to the system ? , i tried via char and code but seem not to react . i basicly want to send things like Alt+F9


#2

I played with it a bit. I was aababable to send to notepad the letters a and b sending 2 bangs to BinSize.

LFO.Change > Select.Input
Select.Select = 2
Just added this nodes to SendKeyboard helppatch.

I’ll leave the errors as proof.

Edit: Played a little bit more, trying to Ctrl C some selected text. No fun ensued. Maybe the keyword is that “serially” one. 2 nodes, one always sending, always seen as separate input… no solution here, sorry…

Edit 2: I have been able to open windows start menu, via Ctrl Esc, but still no Ctrl C, although when trying to paste this got out
Access violation at address 00000000009F173D in module 'vvvv.exe'. Read of address 0000000000000000
Anyway not as Key Code or Key Char I’ve been able to associate Ctrl and c.

Edit 3: I got to copy something!

So the most important thing, found in docs, is that KeyPress event is not raised by non-character keys other than space and backspace; however, the non-character keys do raise the KeyDown and KeyUp events. So going with KeyDown made this working.

Still got nothing with Alt FN, though…

Edit 4:

https://msdn.microsoft.com/en-us/library/windows/desktop/gg153546(v=vs.85).aspx

Here seems that Alt key triggers SysKeyDown\Up, not the regular KeyDown\Up. Indeed I tried and F10, brought up\highlighted a window menu bar, but Alt did nothing. So maybe SendKeyboard is missing this feature (@joreg, maybe)?


#3

Hello, thank you for your findings.

Yes looks like something wrong or missing.

Lets see what devs say about it.?

Cheers


#4

hei color,

sorry for late and sorry for not providing an answer to why this doesn’t work with the SendKeyboard (System). i tried it and it behaved weird… so i gave it a go using vl:

if not, what is weird, i noticed it also apparently sends a CTRL key. so as alternative to the MENU (which i gather is ALT) you could also try LMENU and see if that makes a difference.


#5

Thanks joreg for your hints. I would have prefered to have the keyboard nodes to work as expected :D.

I, ll try the vl dll option aproach sometime.

Cheers


#6

Hi,

i was trying to do the vl patch using the InputSimulator dll i download the master from here and compiled with visual studio then use the dll in the debug folder anycpu.

i drag that dll to a vl path and then look for nodes that include the inputSimulator which seem to be those if i,m not wrong :

now how do i combine those plus other nodes to create a vl path to simulate keyboard keys and mouse ?

InputSimulator.zip (37.0 KB)


#7

what you need is the Create node of InputSimulator, but without the input pins. this is a bit tricky, when you click on Create just click OK in the node browser:

put the create node on create, since you only need to create the simulator once, and then use the Mouse or Keyboard property of it to send the input simulations:

InputSimulator.zip (36.8 KB)


#8

Hi tonfilm , thanks a lot for explanation and example.

some more doubts came.

is the modifiedKeyStroke from the dll or from vl nodes already ?

how to know which one to choose ?

I recreate it and i think i made it work but then i remake it again and does not work anymore ;D

Edit: it was the way i created the create node. works now.

what does the white links means ?

do you think its possible to send combined keys like alt + i + f9 + win + 4 ? if so how ?

btw i did not see the key ALT in the list.

InputSimulator.zip (38.1 KB)


#9

its in the dll.

this depends on the library. read the documentation of the library or the help text of the nodes.

white and gray are different operations of your patch. Create (white) gets called before the first frame, this is where you create all the instances that you will use on Update (gray) which is basically the mainloop in most cases.

so in your case you need to create one instance of the InputSimulator on Create and store it into a Pad (like in my patch above) to use it on Update. so your patch is missing the Pad to store the instance. this is also the reason why most links are white in your patch, there is no Pad anywhere to send data between Create and Update, so the compiler puts everything on create, because one of your nodes is probably assigned to create. you can SHIFT+double click a link to insert a pad.[quote=“colorsound, post:8, topic:15725”]
do you think its possible to send combined keys like alt + i + f9 + win + 4 ? if so how ?
[/quote]

there are other versions of the ModifiedKeyStroke node that takes a Sequence of keys (and/or modifier keys) instead of only one, so yes at works.

ALT is for some reason it’s called MENU in this library, there is also LMENU und RMENU: https://github.com/michaelnoonan/inputsimulator/blob/master/WindowsInput/Native/VirtualKeyCode.cs#L658


#10

learn more about Create and Update here:


#11

Hi, ok thx i get a few things but just a few ;D

why do i get a yellow link when connecting with one create inputsimulator ?

if i make a new one for the multiple i dont get yellow so this option is the way to go ?

btw i got strange behaviours like if inputs were hang or clink repetitively then until hide or move patch around like if it was a refresh thing.

also seem to work without the pads too.

i tried to add the mouse part but not sure if i failed , all this is for learning purposes btw.

i put some notes in the patch. InputSimulator.zip (42.5 KB)

thanks for link i watched already but i,ll do again i need to redo practice to get used , comfortable and learn misterius powerful vl ;D


#12

if you hover the link there is a warning in the tooltip that tells you that you send a reference to two sinks. in your case that doesn’t matter.[quote=“colorsound, post:11, topic:15725”]
if i make a new one for the multiple i dont get yellow so this option is the way to go ?
[/quote]

it only “seems” to work. because like this you create a new (or even two in the second screenshot) input simulator in every frame, which is not very expensive in your case but the new input simulator doesn’t know anything about the last frame and this might break the keyboard state.

so do it like in my patch, one Create [InputSimulator] assigned to create, store that instance in a pad and use that instance on update to execute the key strokes.