How do I handle combination key strokes, like Ctrl-Shift-V?

xuanbao · · 442 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I would like to make a program that, when supplied with a shortcut key of my choosing, prints &#34;Hello World&#34;.</p> <hr/>**评论:**<br/><br/>IanS_5: <pre><p>Are you using some kind of GUI library? If so you should look at the docs for that library, (or post the name and chances are someone in <a href="/r/golang" rel="nofollow">r/golang</a> will be able to help). Otherwise , if your just in the terminal it’s going to be a bit more tricky. probably your best, and most platform independent solution would be using the events in <a href="https://github.com/nsf/termbox-go" rel="nofollow">https://github.com/nsf/termbox-go</a>.</p></pre>oracham: <pre><p>Not using gui. I am just learning golang and was thinking of creating a simple daemon which plays an mp3 file whenever it detects a key stroke. I did stumble upon termbox, but it seemed like an overkill. Still, I will give it another go (pardon the pun).</p></pre>CommonMisspellingBot: <pre><p>Hey, IanS_5, just a quick heads-up:<br/> <strong>independant</strong> is actually spelled <strong>independent</strong>. You can remember it by <strong>ends with -ent</strong>.<br/> Have a nice day!</p> <p><sup><sup><sup><sup>The</sup></sup></sup></sup> <sup><sup><sup><sup>parent</sup></sup></sup></sup> <sup><sup><sup><sup>commenter</sup></sup></sup></sup> <sup><sup><sup><sup>can</sup></sup></sup></sup> <sup><sup><sup><sup>reply</sup></sup></sup></sup> <sup><sup><sup><sup>with</sup></sup></sup></sup> <sup><sup><sup><sup>&#39;delete&#39;</sup></sup></sup></sup> <sup><sup><sup><sup>to</sup></sup></sup></sup> <sup><sup><sup><sup>delete</sup></sup></sup></sup> <sup><sup><sup><sup>this</sup></sup></sup></sup> <sup><sup><sup><sup>comment.</sup></sup></sup></sup></p></pre>jeffrallen: <pre><p>Hey bot, butt out.</p></pre>IanS_5: <pre><p>Well fuck good bot I guess</p></pre>i47: <pre><p><a href="https://stackoverflow.com/questions/38646794/implement-a-global-hotkey-in-golang?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa" rel="nofollow">https://stackoverflow.com/questions/38646794/implement-a-global-hotkey-in-golang?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa</a></p></pre>oracham: <pre><p>Thank you, just what I was looking for, though I am using linux. I&#39;ll try searching wih keywords &#34;global hotkey in golang&#34; for now on.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

442 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传