<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: реализация функции Press any Key]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15081&amp;type=atom" />
	<updated>2019-12-05T22:49:52Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15081</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: реализация функции Press any Key]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136770#p136770" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong><br />Спасибо, вопрос закрыт.</p>]]></content>
			<author>
				<name><![CDATA[Indomito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27285</uri>
			</author>
			<updated>2019-12-05T22:49:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136770#p136770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: реализация функции Press any Key]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136767#p136767" />
			<content type="html"><![CDATA[<p>Можно так:<br /></p><div class="codebox"><pre><code>#Persistent
Hook := InputHook(&quot;V&quot;)
Hook.KeyOpt(&quot;{All}&quot;, &quot;N&quot;)
Hook.OnKeyDown := Func(&quot;AnyKey&quot;)
Hook.Start()
Return

AnyKey(Hook, vk, sc) {
   ToolTip % &quot;key «&quot; . GetKeyName( Format(&quot;vk{:X}sc{:X}&quot;, vk, sc) ) . &quot;» has been pressed&quot;
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-12-05T18:15:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136767#p136767</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: реализация функции Press any Key]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=136764#p136764" />
			<content type="html"><![CDATA[<p>Приветствую.<br />Я конечно читал тему <a href="http://forum.script-coding.com/viewtopic.php?id=5697">Серый форум → Коллекция скриптов и идей → AutoHotkey → AHK: Определение символов, посылаемых с клавиатуры</a>.<br />А можно это сделать проще?</p><p>И не так.</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header"><strong>+</strong>&nbsp;VkScCode_64.ahk</div><div class="fancy_spoiler"><div class="codebox"><pre><code>#Persistent 
#SingleInstance Ignore 

Global verVC64 := 1.2

fnTray()

 hHookKeybd := DllCall(&quot;SetWindowsHookEx&quot;
  , Int, WH_KEYBOARD_LL := 13
  , Ptr, RegisterCallback(&quot;LowLevelKeyboardProc&quot;, &quot;Fast&quot;)
  , Ptr, DllCall(&quot;GetModuleHandle&quot;, UInt, 0, &quot;Ptr&quot;)
  , UInt, 0, &quot;Ptr&quot;)
Return
  
LowLevelKeyboardProc(nCode, wParam, lParam)  {
    Critical
    SetFormat, Integer, H
    vkCode := NumGet(lParam+0, 0, &quot;UInt&quot;) 
;    If (GetKeyState(&quot;LCtrl&quot;, &quot;P&quot;) &amp;&amp; GetKeyState(&quot;LShift&quot;, &quot;P&quot;) &amp;&amp; GetKeyState(&quot;Esc&quot;, &quot;P&quot;))
;        ExitApp 
        
    ToolTip, % Clipboard := wParam . &quot;| vkCode: &quot; . vkCode . &quot; scCode: &quot; . NumGet(lParam+0, 4, &quot;UInt&quot;)
                    . &quot; Extended: &quot; . NumGet(lParam+0, 8, &quot;UInt&quot;) &amp; 1 . &quot; Time: &quot; . NumGet(lParam+0, 12, &quot;UInt&quot;)
    Return DllCall(&quot;CallNextHookEx&quot;, Ptr, 0, Int, nCode, Ptr, wParam, Ptr, lParam)
} 

fnTray()
{
global ;Установки трея для скрипта

    Menu1  := &quot;Выход&quot;

    Menu, tray, NoStandard  ; меню в трее будет не стандартным - своим
      
      ;Добавляем пункт меню по ПКМ
      Menu, tray, add, %Menu1%, lEnd_VkScCode

      
      ; Задаём свою выноску &quot;балон&quot;
      vTip := &quot; ——VK  and  SC Code x86/x64——`n Версия: &quot; verVC64 &quot;`n Автор: Indomito©&quot;
      Menu, tray, tip, %vTip%
      Menu, tray, default, %Menu1%  ; Этот пункт меню по умолчанию двойной щелчёк ЛКМ по иконке в трее для его вызова
      ;Menu, Tray, Click, 1          ; Переназначаем двойной на одиночный ЛКМ      
Return      

}

^+Esc::
ExitApp

lEnd_VkScCode:
  ExitApp
</code></pre></div></div></div><p> Ну очень много кода, хочется по проще.</p>]]></content>
			<author>
				<name><![CDATA[Indomito]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27285</uri>
			</author>
			<updated>2019-12-05T16:10:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=136764#p136764</id>
		</entry>
</feed>
