Simulated Keys

0 views
Skip to first unread message

Dot Liljenquist

unread,
Aug 5, 2024, 1:11:01 AM8/5/24
to esadsusnast
Im working on a little automation module for key presses and mouse-clicks, and while I've found the documentation for SendInput() and the Virtual Key Codes quite helpful for the standard keyboard and mouse input, I'm not sure how I can accomplish this task with the less ASCII-friendly potential input, like say, , or , which would be really helpful when trying to send localized strings to text fields.

I was thinking that using simulated key-presses was the way to go, but now I'm wondering if I should resort to some other sneaky devilry, like putting the string into the clipboard and doing a CTRL + V operation, or something like that and only sending virtual key-presses when appropriate.


Then iterating through each command line argument character-by-character to see if the whole arg only uses keys in the keys map in reference to the virtual key codes. If it does, just simulate the sequence of virtual keyboard key-codes with SendInput(). If it doesn't, I'm assuming it's not a valid direct key-press, and would do something like,


Is there a more straight-forward way to accomplish my goal? If not, any suggestions on how to implement a pasteClipboard style of method? I'm not using anything like Forms or MFC and would prefer to stick to the WINAPIs.


Is there a way to detect simulated keyboard/mouse input on Windows. For example, a user types something on his keyboard vs sendKeys/PostMessage/On-screen keyboard. Is there a way that I can distinguish between the two?


SendInput operates at the bottom level of the input stack. It is just a backdoor into the same input mechanism that the keyboard and mouse drivers use to tell the window manager that the user has generated input. Source:


ok i found simple solution. I would call it walkaround but the end result is precise and using blender tools already available: lets assume we want a mesh with applied cloth to follow an animated armature. 1. we animate our armature to desired position. 2. apply cloth simulation, so it follows animated armature and deform based on our animation. 3. Save cloth as shape key and set it as base key 4. Copy armature to cloth 5. save armature as shape key 6. set armature shape key to -1. This reverse armature rest pose.


1 i did an animation of amrs in principales positions.

2 i did the cloth sim and make it as shapekeys

3 i made armature poses as shape keys

4 i tried to reverse armature keys by -1 but the result is just horrible.


This project shows how to use some of the functionality offered in the User32.dll that comes with Windows to simulate keyboard usage. I extended the use of a couple of already existing forum posts to show how to convert a string to an array of virtual keys that can then be used to simulate keyboard usage.


This is not working properly in LabVIEW 64-bit because of aligning issues. As you maybe know, on Windows 64-bit memory data is aligned naturally up to 8-byte boundaries. So if you pass a byte array to SendInput, you have to insert the padding bytes to the cluster in order to get the function working. Based on that the INPUT structure should look like this:


Well, if you do these changes to your code, you get it working. But as to me it's easier to use native LabVIEW clusters as structures. When passing some cluster to the external library, LabVIEW takes the alignment into the account and adds padding bytes automatically. So, you might get something like this:


In this example I move the mouse to the specific coords and do a single left-button click. The cluster array is passed to SendInput as "Adapt To Type" -> "Array Data Pointer". Works fine in LabVIEW 2017 64-bit.


I have found one purely LabVIEW-specific bug in this example. When I enter some string in "Input control" with line breaks (done by main Enter key), the program reenters only the symbols before the very first line break, truncating the final string. Say, I entered this text:


I see that String to Virtual Key Array VI works fine and outputs Enter as 525. Then in Generate SendInput Data VI it splits into 2 (Control keycode) and 13 (Enter keycode). The VI passes Control into next VIs, not taking any actions here, but it's not always correct when using LabVIEW string controls. There's a special option in LabVIEW settings, which governs the behavior of the string control, when Enter key is pressed. It's called End text entry with Enter key and located at Environment page of Options window. When this checkbox is unchecked, a single Enter press moves the cursor to the next line, but Ctrl+Enter press ends the input. When the checkbox is checked, it works all the way around. So, this use case should be considered in the code, when using LV string control as a keys receiver for SendInput function. Well, I know that the option described corresponds to returnKeyAction string in LabVIEW.ini file (checked - True, unchecked - not present or False). So, I suggest using this private property to obtain the token from LabVIEW.ini:


So, when the keycode contains both Control and Enter keycodes, we check returnKeyAction parameter. If it's not found or False, we output zero instead of Control code. If it's present, we output Control code as usual.


I have posted a snippet with this property above, so you may save it and drag'n'drop to your block diagram. Or you may get access to a number of private properties by adding SuperSecretPrivateSpecialStuff=True to your LabVIEW.ini file. But be careful with it, because the most of them are neither stable, nor documented. You should play with it at your own risk.


The site is secure.

The ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.


Plants are subjected to a multitude of stimuli during insect herbivory, resulting in a complex and cumulative defence response. Breaking down the components of herbivory into specific stimuli and identifying the mechanisms of defence associated with them has thus far been challenging. Advances in our understanding of responses to inconspicuous stimuli, such as those induced by microbial symbionts in herbivore secretions and mechanical stimulation caused by insects, have illuminated the intricacies of herbivory. Here, we provide a synthesis of the interacting impacts of herbivory on plants and the consequential complexities associated with uncoupling defence responses. We propose that simulated herbivory should be used to complement true herbivory to decipher the mechanisms of insect herbivore-induced plant defence responses.


I don't know how to add this question into this issue below.

So I'm going to ask it here & display the issue and the solution below.

First, when I want to break up a line to begin the info on the following line (called a Line Break)

I use the Windows "SHIFT + ENTER" keys in Word, etc. I don't remember if I've done that in MP3Tag.

It's logical to me that Comments should always be multi-line.

So if I use the instructions below will this become the default then for all future COMMENT fields when I use MP3Tag. I hope so (that would save a lot of time). Please let me know either way.

I can't imagine why you wouldn't have COMMENT(s) as multi-line.


Right-click in the grey area of the tag panel and select "Adapt ..." in the menu or use File>Options>Tag-Panel.

There select the entry for Comment and click the Edit button.

In the drop-down list for "Size" select "multiline".


The mulitline property describes the way that MP3tag displays a field in the tag panel.

It does not say anything about what a player then makes of it.

In the tag panel you can use the simple Enter key (without any modifier) to create a new line.


or just make acknowledge of this fact: I use multiple descriptions of years, each meaning a different thing - thus I need more than one tag field for them



And now: if I want to see in my audio proper a vital info to me about years / dates, I need to populated the COMMENT tag field with some of them. And as a single year is written with only 4 digits and only rarely there are more [for example, without going into details, 1993-1996] I do not need more than one line for this tag field in my Tag Pnael


A virtual keyboard is software that is used to emulate a standard keyboard. A picture of a keyboard is displayed on a computer screen and the user points and clicks on the pictures of keys to enter text. Switches activated in a wide variety of ways make use of the most appropriate muscles for the individual user. Virtual keyboards allow computer use by people with significant mobility impairments. Some virtual keyboards incorporate word prediction to increase entry speed.


Use your computer mouse or keyboard to play the virtual piano keyboard (or the device touch screen for mobile devices). You can view the corresponding computer keyboard letters by activating the Real Keys feature. For the entire keyboard spectrum, click it twice.


Metronome The Metronome feature enables you to play at a regular tempo. Use it to improve your timing.

You can adjust the Metronome based on BPM (beats per minute) or time signature.


A virtual piano keyboard is perfect when there isn't a real piano or a keyboard at home or when your piano or keyboard isn't next to a computer. The online piano keyboard simulates a real piano keyboard with 7 1/4 octaves of 88 keys (only five octaves for mobile devices), a sustain pedal, ABC or DoReMe letter notes representation, a Metronome, zoom-in, and a full-screen mode.


Use your computer mouse or keyboard to play the virtual piano keyboard (or the device touch screen for mobile devices). You can view the corresponding computer keyboard letters by activating the "Real Keys" feature. For the entire keyboard spectrum, click it twice.


All rights reserved is a phrase that originated in copyright law as a formal requirement for copyright notice. It indicates that the copyright holder reserves, or holds for their own use, all the rights provided by copyright law, such as distribution, performance, and creation of derivative works that is, they have not waived any such right.

3a8082e126
Reply all
Reply to author
Forward
0 new messages