<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3406258989593698179</id><updated>2025-11-30T23:18:58.058+03:00</updated><category term="development"/><category term="hotkey"/><category term="java"/><category term="keyboard"/><category term="shortcut"/><title type='text'>Java development tips</title><subtitle type='html'>Java development</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://biletnikov-dev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3406258989593698179/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://biletnikov-dev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sergei Biletnikov</name><uri>http://www.blogger.com/profile/17487931154488650606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyngJBFsxWhhB5lJUdxSnXNr-3faHjqYk62WAoVq45MMtBDuC14JLKN6zWb_rtQIWbTWjV_9VHpVn2Vt-r-iDvogSmi8QclDOak7kiKaCUSaSfm2AKhsySrHmnHNWQR4A/s220/Avatar.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3406258989593698179.post-6933901055363044748</id><published>2009-09-25T23:48:00.011+03:00</published><updated>2013-01-25T20:13:03.510+03:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="development"/><category scheme="http://www.blogger.com/atom/ns#" term="hotkey"/><category scheme="http://www.blogger.com/atom/ns#" term="java"/><category scheme="http://www.blogger.com/atom/ns#" term="keyboard"/><category scheme="http://www.blogger.com/atom/ns#" term="shortcut"/><title type='text'>Global hotkeys for Java applications under Windows OS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background: white; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: Times; font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 18px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background: white; margin-bottom: .0001pt; margin: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: Times; font-size: large;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Hello all readers.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;I would like to present the solution which helps me to realize the working with Global hotkeys in a Java application under Windows OS.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;As we remember, Java allows to catch keyboard events for a key or for a key combination, but this works only if the Java application frame or console is active at this moment, but if the user opens or select antoher window, the keyboard events will not reach our Java application. Each application has own event(message) queue and the keyboard events will be sent into this queue unless the application window(console) is active.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;To catch global events the program should use special system functions, but Java machine does not provide us this facility by using Java SDK.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;So we should develop own solution for managing global hotkeys out of Java sandbox.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;My solution is to create a system library (DLL) which can easily calls necessary system functions to listen the global hotkey events. The DLL will be linked up with our Java application with the aid of Java Native Interface (JNI).&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;The solution which I presented bellow, concerns Windows OS and will not work under Linux.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Let&#39;s start!&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;According to my plan I am going to create the DLL (Dynamic-link library), which will be used by our Java application. The DLL will be initialized by the Java application and the global keyboard events will be managed by the DLL.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;The role of Java application is to check the runtime state of the DLL instance periodically. If the hotkey combination was pressed the state of the DLL instance will be changed by setting a special flag.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; margin: 0cm;&quot;&gt;
&lt;div style=&quot;font-size: x-large;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;I used MS Visual Studio 10 and C++ language for developing of the DLL:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: x-large;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;on the project page you can find source codes and compiled versions for 32 and 64 bit platforms.&lt;/span&gt;&lt;/div&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 17.77777862548828px;&quot;&gt;&lt;a href=&quot;http://code.google.com/p/jkeyboard-hook/&quot;&gt;http://code.google.com/p/jkeyboard-hook/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Let&#39;s start to &amp;nbsp;overview my solution from the Java part:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;I created the simple testing class for the demonstration of hotkey catching.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;We are going to test our keyboard hook on a random hotkey combination like as&amp;nbsp;&lt;b&gt;&quot;CTRL + ALT + H&quot;&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;You can see that we create&amp;nbsp;&lt;b&gt;GlobalKeyboardHook&lt;/b&gt;&amp;nbsp;instance, and specify our hotkey combination with the help of boolean flags and the virtual key value.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Verdana; font-size: 24pt;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;font-size: x-large;&quot; type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-image: initial; background-position: initial initial; background-repeat: initial; background: white; color: black; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;KeyEvent.VK_H      - Virtual key code for the &quot;H&quot;.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-image: initial; background-position: initial initial; background-repeat: initial; background: white; color: black; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;ALT_Key      - if the ALT key is used&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-image: initial; background-position: initial initial; background-repeat: initial; background: white; color: black; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;CTRL_Key      - if the CTRL key is used&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-image: initial; background-position: initial initial; background-repeat: initial; background: white; color: black; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;SHIFT_Key      - if the SHIFT key is used&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-image: initial; background-position: initial initial; background-repeat: initial; background: white; color: black; mso-list: l2 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;WIN_Key      - if the special &quot;Win&quot; keys are used. These keys have Windows      logo.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;If the hotkey combination is set, the program can start the hook.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;After that the hook will be started, the program waits for the hotkey is pressed to print the&amp;nbsp;&lt;b&gt;&quot;CTRL + ALT + H was pressed&quot;&lt;/b&gt;&amp;nbsp;message&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;com.biletnikov.hotkeys.Main.java:&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;package&amp;nbsp;com.biletnikov.hotkeys;&lt;br /&gt;
import&amp;nbsp;java.awt.event.KeyEvent;&lt;br /&gt;
/**&lt;br /&gt;
*&amp;nbsp;Testing!&lt;br /&gt;
*&amp;nbsp;@author&amp;nbsp;Sergei.Biletnikov&lt;br /&gt;
*/&lt;br /&gt;
public&amp;nbsp;class&amp;nbsp;Main{&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;static&amp;nbsp;void&amp;nbsp;main(String[]&amp;nbsp;argv)&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;GlobalKeyboardHook&amp;nbsp;hook&amp;nbsp;=&amp;nbsp;new&amp;nbsp;GlobalKeyboardHook();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Let&amp;nbsp;me&amp;nbsp;define&amp;nbsp;the&amp;nbsp;following&amp;nbsp;hotkeys:&amp;nbsp;CTRL&amp;nbsp;+&amp;nbsp;ALT&amp;nbsp;+&amp;nbsp;H&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int&amp;nbsp;vitrualKey&amp;nbsp;=&amp;nbsp;KeyEvent.VK_H;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;boolean&amp;nbsp;CTRL_Key&amp;nbsp;=&amp;nbsp;true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;boolean&amp;nbsp;ALT_Key&amp;nbsp;=&amp;nbsp;true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;boolean&amp;nbsp;SHIFT_Key&amp;nbsp;=&amp;nbsp;false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;boolean&amp;nbsp;WIN_Key&amp;nbsp;=&amp;nbsp;false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hook.setHotKey(vitrualKey,&amp;nbsp;ALT_Key,&amp;nbsp;CTRL_Key,&amp;nbsp;SHIFT_Key,&amp;nbsp;WIN_Key);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hook.startHook();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;waiting&amp;nbsp;for&amp;nbsp;the&amp;nbsp;event&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hook.addGlobalKeyboardListener(new&amp;nbsp;GlobalKeyboardListener()&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;void&amp;nbsp;onGlobalHotkeysPressed()&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&quot;CTRL&amp;nbsp;+&amp;nbsp;ALT&amp;nbsp;+&amp;nbsp;H&amp;nbsp;was&amp;nbsp;pressed&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;});&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(&quot;The&amp;nbsp;program&amp;nbsp;waiting&amp;nbsp;for&amp;nbsp;CTRL+ALT+H&amp;nbsp;hotkey...&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
}&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Nothing special here, it is just a Listener interface.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;com.biletnikov.hotkeys.GlobalKeyboardListener.java:&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;package&amp;nbsp;com.biletnikov.hotkeys;&lt;br /&gt;
import&amp;nbsp;java.util.EventListener;&lt;br /&gt;
/**&lt;br /&gt;
*&amp;nbsp;Hotkeys&amp;nbsp;listener.&lt;br /&gt;
*&amp;nbsp;@author&amp;nbsp;Sergei.Biletnikov&lt;br /&gt;
*/&lt;br /&gt;
public&amp;nbsp;interface&amp;nbsp;GlobalKeyboardListener&amp;nbsp;extends&amp;nbsp;EventListener&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;void&amp;nbsp;onGlobalHotkeysPressed();&lt;br /&gt;
&lt;br /&gt;
}&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;GlobalKeyboardHook&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;loads DLL that must be placed in the classpath of the Java application, initializes it through the native methods and starts the special thread (DLLStateThread) which checks the state of the DLL instance every 100 ms.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;If the hotkey event is occurred the&amp;nbsp;DLLStateThread&amp;nbsp;gets to know about this from the DLL instance by JNI and calls the event listeners.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;To link up the DLL with the Java application through JNI, we should generate the header file in C++ which regards to the class that contains native methods (GlobalKeyboardHook).&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Compile the java classes and execute:&amp;nbsp;&lt;b&gt;%JAVA_HOME%\bin\javah -jni com.biletnikov.hotkeys.GlobalKeyboardHook&amp;nbsp;&lt;/b&gt;to generate the header file:&lt;b&gt;&amp;nbsp;com_biletnikov_hotkeys_GlobalKeyboardHook.h&lt;/b&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;com.biletnikov.hotkeys.GlobalKeyboardHook.java:&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;package&amp;nbsp;com.biletnikov.hotkeys;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;import&amp;nbsp;java.util.List;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;import&amp;nbsp;java.util.ArrayList;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;*&amp;nbsp;Global&amp;nbsp;keyboard&amp;nbsp;hook&amp;nbsp;at&amp;nbsp;the&amp;nbsp;Java&amp;nbsp;side.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;*&amp;nbsp;@author&amp;nbsp;Sergei.Biletnikov&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;public&amp;nbsp;class&amp;nbsp;GlobalKeyboardHook&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;-----------&amp;nbsp;Java&amp;nbsp;Native&amp;nbsp;methods&amp;nbsp;-------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Checks&amp;nbsp;if&amp;nbsp;the&amp;nbsp;hotkeys&amp;nbsp;were&amp;nbsp;pressed.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;@return&amp;nbsp;true&amp;nbsp;if&amp;nbsp;they&amp;nbsp;were&amp;nbsp;pressed,&amp;nbsp;otherwise&amp;nbsp;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;native&amp;nbsp;boolean&amp;nbsp;checkHotKey();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Sets&amp;nbsp;the&amp;nbsp;hot&amp;nbsp;key.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;virtualKey&amp;nbsp;Specifies&amp;nbsp;the&amp;nbsp;virtual-key&amp;nbsp;code&amp;nbsp;of&amp;nbsp;the&amp;nbsp;hot&amp;nbsp;key.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;alt&amp;nbsp;Either&amp;nbsp;ALT&amp;nbsp;key&amp;nbsp;must&amp;nbsp;be&amp;nbsp;held&amp;nbsp;down.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;control&amp;nbsp;Either&amp;nbsp;CTRL&amp;nbsp;key&amp;nbsp;must&amp;nbsp;be&amp;nbsp;held&amp;nbsp;down.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;shift&amp;nbsp;Either&amp;nbsp;SHIFT&amp;nbsp;key&amp;nbsp;must&amp;nbsp;be&amp;nbsp;held&amp;nbsp;down.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;@param&amp;nbsp;win&amp;nbsp;Either&amp;nbsp;WINDOWS&amp;nbsp;key&amp;nbsp;was&amp;nbsp;held&amp;nbsp;down.&amp;nbsp;These&amp;nbsp;keys&amp;nbsp;are&amp;nbsp;labeled&amp;nbsp;with&amp;nbsp;the&amp;nbsp;Microsoft&amp;nbsp;Windows&amp;nbsp;logo.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Keyboard&amp;nbsp;shortcuts&amp;nbsp;that&amp;nbsp;involve&amp;nbsp;the&amp;nbsp;WINDOWS&amp;nbsp;key&amp;nbsp;are&amp;nbsp;reserved&amp;nbsp;for&amp;nbsp;use&amp;nbsp;by&amp;nbsp;the&amp;nbsp;operating&amp;nbsp;system.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;@return&amp;nbsp;If&amp;nbsp;the&amp;nbsp;function&amp;nbsp;succeeds,&amp;nbsp;the&amp;nbsp;return&amp;nbsp;value&amp;nbsp;is&amp;nbsp;TRUE.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;native&amp;nbsp;boolean&amp;nbsp;setHotKey(int&amp;nbsp;virtualKey,&amp;nbsp;boolean&amp;nbsp;alt,&amp;nbsp;boolean&amp;nbsp;control,&amp;nbsp;boolean&amp;nbsp;shift,&amp;nbsp;boolean&amp;nbsp;win);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Resets&amp;nbsp;the&amp;nbsp;installed&amp;nbsp;hotkeys.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;native&amp;nbsp;void&amp;nbsp;resetHotKey();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;-------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;GlobalKeyboardHook.dll&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;static&amp;nbsp;final&amp;nbsp;String&amp;nbsp;KEYBOARD_HOOOK_DLL_NAME&amp;nbsp;=&amp;nbsp;&quot;GlobalKeyboardHook&quot;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;For&amp;nbsp;stopping&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;boolean&amp;nbsp;stopFlag;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;--------&amp;nbsp;Java&amp;nbsp;listeners&amp;nbsp;--------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;List&amp;nbsp;listeners&amp;nbsp;=&amp;nbsp;new&amp;nbsp;ArrayList();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Constructor.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;GlobalKeyboardHook()&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;load&amp;nbsp;KeyboardHookDispatcher.dll&amp;nbsp;in&amp;nbsp;the&amp;nbsp;classpath&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.loadLibrary(KEYBOARD_HOOOK_DLL_NAME);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.out.println(KEYBOARD_HOOOK_DLL_NAME&amp;nbsp;+&amp;nbsp;&quot;.dll&amp;nbsp;was&amp;nbsp;loaded&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stopFlag&amp;nbsp;=&amp;nbsp;false;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;void&amp;nbsp;addGlobalKeyboardListener(GlobalKeyboardListener&amp;nbsp;listener)&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listeners.add(listener);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;void&amp;nbsp;removeGlobalKeyboardListener(GlobalKeyboardListener&amp;nbsp;listener)&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listeners.remove(listener);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Start&amp;nbsp;the&amp;nbsp;hook.&amp;nbsp;Create&amp;nbsp;and&amp;nbsp;run&amp;nbsp;DLLStateThread&amp;nbsp;thread,&amp;nbsp;for&amp;nbsp;checking&amp;nbsp;the&amp;nbsp;DLL&amp;nbsp;status.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;void&amp;nbsp;startHook()&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stopFlag&amp;nbsp;=&amp;nbsp;false;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;DLLStateThread&amp;nbsp;currentWorker&amp;nbsp;=&amp;nbsp;new&amp;nbsp;DLLStateThread();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Thread&amp;nbsp;statusThread&amp;nbsp;=&amp;nbsp;new&amp;nbsp;Thread(currentWorker);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;statusThread.start();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Finish&amp;nbsp;the&amp;nbsp;current&amp;nbsp;KeyboardThreadWorker&amp;nbsp;instance.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;void&amp;nbsp;stopHook()&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;stopFlag&amp;nbsp;=&amp;nbsp;true;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Sends&amp;nbsp;the&amp;nbsp;event&amp;nbsp;notification&amp;nbsp;to&amp;nbsp;all&amp;nbsp;listeners.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;void&amp;nbsp;fireHotkeysEvent()&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;(GlobalKeyboardListener&amp;nbsp;listener&amp;nbsp;:&amp;nbsp;listeners)&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;listener.onGlobalHotkeysPressed();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/**&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;This&amp;nbsp;class&amp;nbsp;is&amp;nbsp;base&amp;nbsp;for&amp;nbsp;the&amp;nbsp;thread,&amp;nbsp;which&amp;nbsp;monitors&amp;nbsp;DLL&amp;nbsp;status.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;private&amp;nbsp;class&amp;nbsp;DLLStateThread&amp;nbsp;implements&amp;nbsp;Runnable&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public&amp;nbsp;void&amp;nbsp;run()&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for(;;)&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;boolean&amp;nbsp;hotKeyPressed&amp;nbsp;=&amp;nbsp;checkHotKey();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(hotKeyPressed)&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;hot&amp;nbsp;key&amp;nbsp;was&amp;nbsp;pressed,&amp;nbsp;send&amp;nbsp;the&amp;nbsp;event&amp;nbsp;to&amp;nbsp;all&amp;nbsp;listeners&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fireHotkeysEvent();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Thread.sleep(100);&amp;nbsp;//every&amp;nbsp;100&amp;nbsp;ms&amp;nbsp;check&amp;nbsp;the&amp;nbsp;DLL&amp;nbsp;status.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;work&amp;nbsp;unless&amp;nbsp;stopFlag&amp;nbsp;==&amp;nbsp;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(stopFlag)&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resetHotKey();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;catch&amp;nbsp;(InterruptedException&amp;nbsp;e)&amp;nbsp;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e.printStackTrace();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt; &lt;/span&gt;&lt;code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: &#39;\&#39;ɼourier New\\\&#39;\&#39;&#39;; font-size: 13.5pt;&quot;&gt;com_biletnikov_hotkeys_GlobalKeyboardHook.h:&lt;/span&gt;&lt;/b&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;/*&amp;nbsp;DO&amp;nbsp;NOT&amp;nbsp;EDIT&amp;nbsp;THIS&amp;nbsp;FILE&amp;nbsp;-&amp;nbsp;it&amp;nbsp;is&amp;nbsp;machine&amp;nbsp;generated&amp;nbsp;*/&lt;br /&gt;
#include&lt;br /&gt;
/*&amp;nbsp;Header&amp;nbsp;for&amp;nbsp;class&amp;nbsp;com_biletnikov_hotkeys_GlobalKeyboardHook&amp;nbsp;*/&lt;br /&gt;
&lt;br /&gt;
#ifndef&amp;nbsp;_Included_com_biletnikov_hotkeys_GlobalKeyboardHook&lt;br /&gt;
#define&amp;nbsp;_Included_com_biletnikov_hotkeys_GlobalKeyboardHook&lt;br /&gt;
#ifdef&amp;nbsp;__cplusplus&lt;br /&gt;
extern&amp;nbsp;&quot;C&quot;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#endif&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Class:&amp;nbsp;com_biletnikov_hotkeys_GlobalKeyboardHook&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Method:&amp;nbsp;checkHotKey&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Signature:&amp;nbsp;()Z&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;JNIEXPORT&amp;nbsp;jboolean&amp;nbsp;JNICALL&amp;nbsp;Java_com_biletnikov_hotkeys_GlobalKeyboardHook_checkHotKey&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(JNIEnv&amp;nbsp;*,&amp;nbsp;jobject);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Class:&amp;nbsp;com_biletnikov_hotkeys_GlobalKeyboardHook&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Method:&amp;nbsp;setHotKey&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Signature:&amp;nbsp;(IZZZZ)Z&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;JNIEXPORT&amp;nbsp;jboolean&amp;nbsp;JNICALL&amp;nbsp;Java_com_biletnikov_hotkeys_GlobalKeyboardHook_setHotKey&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(JNIEnv&amp;nbsp;*,&amp;nbsp;jobject,&amp;nbsp;jint,&amp;nbsp;jboolean,&amp;nbsp;jboolean,&amp;nbsp;jboolean,&amp;nbsp;jboolean);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;/*&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Class:&amp;nbsp;com_biletnikov_hotkeys_GlobalKeyboardHook&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Method:&amp;nbsp;resetHotKey&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*&amp;nbsp;Signature:&amp;nbsp;()V&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;*/&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;JNIEXPORT&amp;nbsp;void&amp;nbsp;JNICALL&amp;nbsp;Java_com_biletnikov_hotkeys_GlobalKeyboardHook_resetHotKey&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(JNIEnv&amp;nbsp;*,&amp;nbsp;jobject);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;#ifdef&amp;nbsp;__cplusplus&lt;br /&gt;
}&lt;br /&gt;
#endif&lt;br /&gt;
#endif&lt;/span&gt;&lt;/span&gt;    &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Open you IDE for building the DLL. In my case it is Visual Studio 6.0.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Create a DLL project with Microsoft Visual Studio (or other IDE).&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Add&amp;nbsp;&lt;b&gt;com_biletnikov_hotkeys_GlobalKeyboardHook.h&lt;/b&gt;&amp;nbsp;and all C++ header files which you can find in the&amp;nbsp;&lt;b&gt;%JDK_HOME%\include\&lt;/b&gt;&amp;nbsp;directory.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Create the main C++ file:&amp;nbsp;&lt;b&gt;GlobalKeyboardHook.cpp&lt;/b&gt;, with the following content:&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: black; font-family: &#39;ɼourier New\&#39;&#39;; font-size: 13.5pt;&quot;&gt;GlobalKeyboardHook.cpp:&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;/*&lt;br /&gt;
*&amp;nbsp;Global&amp;nbsp;Keyboard&amp;nbsp;hook&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
*&amp;nbsp;JNI&amp;nbsp;Interface&amp;nbsp;for&amp;nbsp;setting&amp;nbsp;a&amp;nbsp;Keyboard&amp;nbsp;Hook&amp;nbsp;and&amp;nbsp;monitoring&lt;br /&gt;
*&amp;nbsp;it&amp;nbsp;Java-side&lt;br /&gt;
*&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#include&lt;br /&gt;
#include&amp;nbsp;&quot;windows.h&quot;&lt;br /&gt;
#include&amp;nbsp;&quot;Winuser.h&quot;&lt;br /&gt;
#include&amp;nbsp;&quot;jni.h&quot;&lt;br /&gt;
#include&amp;nbsp;&quot;com_biletnikov_hotkeys_GlobalKeyboardHook.h&quot;&lt;br /&gt;
&lt;br /&gt;
#pragma&amp;nbsp;data_seg(&quot;.HOOKDATA&quot;)&amp;nbsp;//Shared&amp;nbsp;data&amp;nbsp;among&amp;nbsp;all&amp;nbsp;instances.&lt;br /&gt;
&lt;br /&gt;
static&amp;nbsp;HHOOK&amp;nbsp;hotKeyHook&amp;nbsp;=&amp;nbsp;NULL;&lt;br /&gt;
static&amp;nbsp;HANDLE&amp;nbsp;g_hModule&amp;nbsp;=&amp;nbsp;NULL;&lt;br /&gt;
&lt;br /&gt;
const&amp;nbsp;int&amp;nbsp;HOT_KEY_ID&amp;nbsp;=&amp;nbsp;0xBBBC;&lt;br /&gt;
static&amp;nbsp;int&amp;nbsp;hotKeyRegisterStatus&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt;
&lt;br /&gt;
//&amp;nbsp;Hot&amp;nbsp;key&amp;nbsp;settings&lt;br /&gt;
static&amp;nbsp;int&amp;nbsp;keyModifiers&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt;
static&amp;nbsp;int&amp;nbsp;virtualKey&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt;
//&lt;br /&gt;
static&amp;nbsp;int&amp;nbsp;hotKeyPressedFlag&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt;
&lt;br /&gt;
HANDLE&amp;nbsp;messageThreadEvent&amp;nbsp;=&amp;nbsp;NULL;&lt;br /&gt;
HANDLE&amp;nbsp;messageThread&amp;nbsp;=&amp;nbsp;NULL;&lt;br /&gt;
DWORD&amp;nbsp;messageThreadID;&lt;br /&gt;
&lt;br /&gt;
#pragma&amp;nbsp;data_seg()&lt;br /&gt;
#pragma&amp;nbsp;comment(linker,&amp;nbsp;&quot;/SECTION:.HOOKDATA,RWS&quot;)&lt;br /&gt;
/*&lt;br /&gt;
*&amp;nbsp;Class:&amp;nbsp;de_alfah_popup_jni_KeyboardHookThread&lt;br /&gt;
*&amp;nbsp;Method:&amp;nbsp;checkHotKey&lt;br /&gt;
*&amp;nbsp;Signature:&amp;nbsp;()Z&lt;br /&gt;
*/&lt;br /&gt;
JNIEXPORT&amp;nbsp;jboolean&amp;nbsp;JNICALL&amp;nbsp;Java_com_biletnikov_hotkeys_GlobalKeyboardHook_checkHotKey&lt;br /&gt;
(JNIEnv&amp;nbsp;*env,&amp;nbsp;jobject&amp;nbsp;obj)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int&amp;nbsp;pressedFlag&amp;nbsp;=&amp;nbsp;hotKeyPressedFlag;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hotKeyPressedFlag&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;pressedFlag&amp;nbsp;!=&amp;nbsp;0&amp;nbsp;?&amp;nbsp;JNI_TRUE&amp;nbsp;:&amp;nbsp;JNI_FALSE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
DWORD&amp;nbsp;WINAPI&amp;nbsp;HotKeyListener(LPVOID&amp;nbsp;lpParameter)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hotKeyRegisterStatus&amp;nbsp;=&amp;nbsp;RegisterHotKey(NULL,&amp;nbsp;HOT_KEY_ID,&amp;nbsp;keyModifiers,&amp;nbsp;virtualKey);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;SetEvent(messageThreadEvent);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(hotKeyRegisterStatus&amp;nbsp;!=0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MSG&amp;nbsp;msg&amp;nbsp;=&amp;nbsp;{0};&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;while&amp;nbsp;(GetMessage(&amp;amp;msg,&amp;nbsp;NULL,&amp;nbsp;0,&amp;nbsp;0)&amp;nbsp;!=&amp;nbsp;0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;switch&amp;nbsp;(msg.message)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case&amp;nbsp;WM_HOTKEY:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hotKeyPressedFlag&amp;nbsp;=&amp;nbsp;1;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;hotKeyRegisterStatus;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//&amp;nbsp;Reset&amp;nbsp;hot&amp;nbsp;keys&amp;nbsp;by&amp;nbsp;terminating&amp;nbsp;the&amp;nbsp;message&amp;nbsp;thread&lt;br /&gt;
static&amp;nbsp;void&amp;nbsp;resetHotKey()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;UnregisterHotKey(NULL,&amp;nbsp;HOT_KEY_ID);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(messageThread&amp;nbsp;!=&amp;nbsp;NULL)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PostThreadMessage((DWORD)&amp;nbsp;messageThreadID,&amp;nbsp;(UINT)&amp;nbsp;WM_QUIT,&amp;nbsp;0,&amp;nbsp;0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;TerminateThread&amp;nbsp;(messageThread,&amp;nbsp;0);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CloseHandle(messageThread);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;messageThread&amp;nbsp;=&amp;nbsp;NULL;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;messageThreadID&amp;nbsp;=&amp;nbsp;NULL;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(messageThreadEvent&amp;nbsp;!=&amp;nbsp;NULL)&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CloseHandle(messageThreadEvent);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;messageThreadEvent&amp;nbsp;=&amp;nbsp;NULL;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;hotKeyRegisterStatus&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//&amp;nbsp;Sets&amp;nbsp;new&amp;nbsp;hot&amp;nbsp;key&lt;br /&gt;
static&amp;nbsp;int&amp;nbsp;setNewHotKey()&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;messageThreadEvent&amp;nbsp;=&amp;nbsp;CreateEvent(&amp;nbsp;NULL,&amp;nbsp;TRUE,&amp;nbsp;TRUE,&amp;nbsp;NULL&amp;nbsp;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;ResetEvent(&amp;nbsp;messageThreadEvent&amp;nbsp;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;messageThread&amp;nbsp;=&amp;nbsp;CreateThread(NULL,&amp;nbsp;0,&amp;nbsp;HotKeyListener,&amp;nbsp;0,0,&amp;amp;messageThreadID);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;WaitForSingleObject(&amp;nbsp;messageThreadEvent,&amp;nbsp;INFINITE&amp;nbsp;);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;hotKeyRegisterStatus;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
*&amp;nbsp;Class:&amp;nbsp;de_alfah_popup_jni_KeyboardHookThread&lt;br /&gt;
*&amp;nbsp;Method:&amp;nbsp;setHotKey&lt;br /&gt;
*&amp;nbsp;Signature:&amp;nbsp;(IZZZZ)Z&lt;br /&gt;
*/&lt;br /&gt;
JNIEXPORT&amp;nbsp;jboolean&amp;nbsp;JNICALL&amp;nbsp;Java_com_biletnikov_hotkeys_GlobalKeyboardHook_setHotKey&lt;br /&gt;
(JNIEnv&amp;nbsp;*,&amp;nbsp;jobject,&amp;nbsp;jint&amp;nbsp;vk,&amp;nbsp;jboolean&amp;nbsp;altKey,&amp;nbsp;jboolean&amp;nbsp;ctrlKey,&amp;nbsp;jboolean&amp;nbsp;shiftKey,&amp;nbsp;jboolean&amp;nbsp;winKey)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;define&amp;nbsp;modifiers&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int&amp;nbsp;modifiers&amp;nbsp;=&amp;nbsp;0;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(altKey&amp;nbsp;==&amp;nbsp;JNI_TRUE)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;modifiers&amp;nbsp;=&amp;nbsp;MOD_ALT;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;if&amp;nbsp;(ctrlKey&amp;nbsp;==&amp;nbsp;JNI_TRUE)&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;modifiers&amp;nbsp;=&amp;nbsp;modifiers&amp;nbsp;|&amp;nbsp;MOD_CONTROL;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;if&amp;nbsp;(shiftKey&amp;nbsp;==&amp;nbsp;JNI_TRUE)&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;modifiers&amp;nbsp;=&amp;nbsp;modifiers&amp;nbsp;|&amp;nbsp;MOD_SHIFT;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;if&amp;nbsp;(winKey&amp;nbsp;==&amp;nbsp;JNI_TRUE)&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;modifiers&amp;nbsp;=&amp;nbsp;modifiers&amp;nbsp;|&amp;nbsp;MOD_WIN;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;set&amp;nbsp;key&amp;nbsp;setings&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;keyModifiers&amp;nbsp;=&amp;nbsp;modifiers;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;virtualKey&amp;nbsp;=&amp;nbsp;vk;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;reset&amp;nbsp;previous&amp;nbsp;hot&amp;nbsp;key&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resetHotKey();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int&amp;nbsp;status&amp;nbsp;=&amp;nbsp;setNewHotKey();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;status&amp;nbsp;==&amp;nbsp;0&amp;nbsp;?&amp;nbsp;JNI_FALSE&amp;nbsp;:&amp;nbsp;JNI_TRUE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*&lt;br /&gt;
*&amp;nbsp;Class:&amp;nbsp;de_alfah_popup_jni_KeyboardHookThread&lt;br /&gt;
*&amp;nbsp;Method:&amp;nbsp;resetHotKey&lt;br /&gt;
*&amp;nbsp;Signature:&amp;nbsp;()V&lt;br /&gt;
*/&lt;br /&gt;
JNIEXPORT&amp;nbsp;void&amp;nbsp;JNICALL&amp;nbsp;Java_com_biletnikov_hotkeys_GlobalKeyboardHook_resetHotKey&lt;br /&gt;
(JNIEnv&amp;nbsp;*&amp;nbsp;env,&amp;nbsp;jobject)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resetHotKey();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
//&amp;nbsp;The&amp;nbsp;main&amp;nbsp;DLL&lt;br /&gt;
BOOL&amp;nbsp;APIENTRY&amp;nbsp;DllMain(&amp;nbsp;HANDLE&amp;nbsp;hModule,&amp;nbsp;DWORD&amp;nbsp;ul_reason_for_call,&amp;nbsp;LPVOID&amp;nbsp;lpReserved&amp;nbsp;)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;switch(ul_reason_for_call)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case&amp;nbsp;DLL_PROCESS_ATTACH:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;g_hModule&amp;nbsp;=&amp;nbsp;hModule;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;TRUE;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;case&amp;nbsp;DLL_PROCESS_DETACH:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;resetHotKey();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;TRUE;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return&amp;nbsp;TRUE;&lt;br /&gt;
}&lt;/span&gt;&lt;/span&gt;                    &lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-size: large;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Compile the DLL.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;The&amp;nbsp;&lt;b&gt;GlobalKeyboardHook.dll&lt;/b&gt;&amp;nbsp;will appear if all things are fine.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;I found two ways how to catch global keyboard events:&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;ul style=&quot;font-size: x-large;&quot; type=&quot;disc&quot;&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-image: initial; background-position: initial initial; background-repeat: initial; background: white; color: black; mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Times; font-size: 13.5pt;&quot;&gt;Using&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 13.5pt;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms644990%28VS.85%29.aspx&quot; id=&quot;ti63&quot; title=&quot;SetWindowsHookEx&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #551a8b; font-family: Times;&quot;&gt;SetWindowsHookEx&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Times; font-size: 13.5pt;&quot;&gt;&amp;nbsp;it is universal hook for many kinds of the events, but it is      not handy for catching more than 2 keys combinations&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;u1:p&gt;&lt;/u1:p&gt;
&lt;li class=&quot;MsoNormal&quot; style=&quot;-webkit-background-clip: initial; -webkit-background-origin: initial; background-attachment: initial; background-image: initial; background-position: initial initial; background-repeat: initial; background: white; color: black; mso-list: l0 level1 lfo3; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 13.5pt;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms646309%28VS.85%29.aspx&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #551a8b; font-family: Times;&quot;&gt;RegisterHotKey&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-family: Times; font-size: 13.5pt;&quot;&gt;&amp;nbsp;is a nice function for catching hotkeys.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;The DLL use&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 13.5pt;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms646309%28VS.85%29.aspx&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #551a8b; font-family: Times;&quot;&gt;RegisterHotKey&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;&amp;nbsp;function to register a hotkey combination.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;The one important aspect is this function sends messages to the message queue of the thread that performed the hotkey registration, therefore we must have a separate thread which fulfills hotkey assigning and listens the message queue.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;For each new hotkey combination, the DLL creates the thread which assigns the required hotkey combination for&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: Verdana; font-size: 13.5pt;&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms646309%28VS.85%29.aspx&quot;&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: #551a8b; font-family: Times;&quot;&gt;RegisterHotKey&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;&amp;nbsp;and&amp;nbsp;waits for the&amp;nbsp;&lt;b&gt;WM_HOTKEY&amp;nbsp;&lt;/b&gt;message.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;The current hook DLL was designed to process one hotkey combination. If we set a new combination, the previous thread will be ended and a new one will be created.&lt;/span&gt;&lt;span lang=&quot;EN-US&quot; style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
P.S.&lt;br /&gt;
&lt;a href=&quot;http://code.google.com/p/jkeyboard-hook/&quot;&gt;http://code.google.com/p/jkeyboard-hook/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-attachment: initial; background-clip: initial; background-color: white; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; font-size: x-large; margin-bottom: 0cm; margin-left: 0cm; margin-right: 0cm; margin-top: 0cm;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Times; font-size: 13.5pt;&quot;&gt;Have nice hotkeys :)&lt;/span&gt;&lt;span style=&quot;color: black; font-size: 13.5pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: large;&quot;&gt;&lt;u1:p&gt;&lt;/u1:p&gt;&lt;/span&gt;  &lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;font-size: x-large;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://biletnikov-dev.blogspot.com/feeds/6933901055363044748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://biletnikov-dev.blogspot.com/2009/09/global-hotkeys-for-java-applications_25.html#comment-form' title='180 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3406258989593698179/posts/default/6933901055363044748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3406258989593698179/posts/default/6933901055363044748'/><link rel='alternate' type='text/html' href='http://biletnikov-dev.blogspot.com/2009/09/global-hotkeys-for-java-applications_25.html' title='Global hotkeys for Java applications under Windows OS'/><author><name>Sergei Biletnikov</name><uri>http://www.blogger.com/profile/17487931154488650606</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='31' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyngJBFsxWhhB5lJUdxSnXNr-3faHjqYk62WAoVq45MMtBDuC14JLKN6zWb_rtQIWbTWjV_9VHpVn2Vt-r-iDvogSmi8QclDOak7kiKaCUSaSfm2AKhsySrHmnHNWQR4A/s220/Avatar.jpg'/></author><thr:total>180</thr:total></entry></feed>