44 lines
1.6 KiB
HTML
44 lines
1.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width">
|
|
<title>GoSmartKeyboard</title>
|
|
<link rel="stylesheet" href="google-code-prettify/prettify.css">
|
|
<link rel="stylesheet" href="styles/prettify-theme.css">
|
|
<script defer src="google-code-prettify/prettify.js"></script>
|
|
<script defer src="google-code-prettify/run_prettify.js"></script>
|
|
<link rel="stylesheet" href="styles/main.css">
|
|
</head>
|
|
|
|
<!-- Generated by srcweave https://github.com/justinmeiners/srcweave -->
|
|
<h1>uinput streaming approach<a id="c18"></a></h1>
|
|
|
|
|
|
|
|
<div class="code-block">
|
|
<span class="block-header">
|
|
<strong class="block-title"><em><a id="do-streaming-keylogger-approach-block-61" href="#do-streaming-keylogger-approach-block-61">do streaming keylogger approach</a></em></strong></span>
|
|
<pre class="prettyprint"><code class="">key := ""
|
|
if strings.HasPrefix(message_string, "{KEYDWN}") {
|
|
key = strings.TrimPrefix(string(message_string), "{KEYDWN}")
|
|
k.Write(1, key)
|
|
} else if strings.HasPrefix(message_string, "{KEYUP}") {
|
|
key = strings.TrimPrefix(string(message_string), "{KEYUP}")
|
|
k.Write(0, key)
|
|
} else if strings.HasPrefix(message_string, "{KEYHLD}") {
|
|
key = strings.TrimPrefix(string(message_string), "{KEYHLD}")
|
|
k.Write(2, key)
|
|
} else{
|
|
for _, key := range message_string {
|
|
// write once will simulate keyboard press/release, for long press or release, lookup at Write
|
|
k.WriteOnce(string(key))
|
|
}
|
|
}
|
|
</code></pre>
|
|
<p class="block-usages"><small>Used by <a href="Streaming.html#send-keys-to-system-block-58" title="send keys to system. Streaming.html">1</a> </small></p></div>
|
|
|
|
|
|
</body>
|
|
</html>
|