Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
string to keycode (keypress)
#2
QM2 can't do it very easily.
To convert simple strings to virtual-key codes, can be used function QmKeyCodeToVK. Then function SendInput.
Or use C# SendKeys. But its keys syntax is different. Reference.

Function CSharpSendKeys
Code:
Copy      Help
;/
function $keys

;Sends keys specified in string.
;Calls .NET function SendKeys.SendWait.
;Syntax reference: <google>C# SendKeys.Send</google>.

;EXAMPLE
;CSharpSendKeys "^a" ;;Ctrl+A


opt noerrorshere 1
CsScript x.AddCode("")
x.Call("Class1.Key" keys)


#ret
//C# code
using System;
using System.Windows.Forms;

public class Class1
{
public static void Key(string keys)
{
,SendKeys.SendWait(keys);
}
}


Messages In This Thread
string to keycode (keypress) - by r0n - 03-08-2020, 06:20 PM
RE: string to keycode (keypress) - by Gintaras - 03-08-2020, 07:15 PM
RE: string to keycode (keypress) - by r0n - 03-08-2020, 07:39 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)