gosmartkeyboard/docs/Editor.html

58 lines
1.5 KiB
HTML
Raw Normal View History

2023-03-07 22:29:26 +00:00
<!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>Input Method Editor<a id="c23"></a></h1>
<p>This tool uses your $EDITOR to buffer keystrokes.</p>
<div class="code-block">
<span class="block-header">
<strong class="block-title"><em><a id="-tools-editor-editor.go-block-83" href="#-tools-editor-editor.go-block-83">/tools/editor/editor.go</a></em></strong></span>
<pre class="prettyprint"><code class="">package main
import (
"io/ioutil"
"os"
)
// #include &lt;stdlib.h&gt;
//
// void vim() {
// system("vi inputfile");
// }
import "C"
func main() {
var inputFile := "inputFile"
<em class="block-link nocode" title="EnvironmentVariables.html"><a href="EnvironmentVariables.html#get-client-fifo-input-file-from-environment-block-20">@{get client fifo input file from environment}</a></em>
C.vim()
data, _ := ioutil.ReadFile(inputFile)
f, err := os.OpenFile(clientFifoInputFile, os.O_WRONLY, 0600)
if err != nil {
panic(err)
}
f.Write(data)
os.Remove(inputFile)
}
</code></pre>
</div>
</body>
</html>