<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Использование клавиш с модификаторами в input.]]></title>
		<link>http://forum.script-coding.com/viewtopic.php?id=12847</link>
		<atom:link href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12847&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Использование клавиш с модификаторами в input.».]]></description>
		<lastBuildDate>Wed, 26 Jul 2017 02:47:09 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117594#p117594</link>
			<description><![CDATA[<p><strong>teadrinker</strong> О то что надо, спасибо огромное. Вроде вьехал.</p>]]></description>
			<author><![CDATA[null@example.com (Viruzober)]]></author>
			<pubDate>Wed, 26 Jul 2017 02:47:09 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117594#p117594</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117593#p117593</link>
			<description><![CDATA[<p>Можно так через <a href="http://forum.script-coding.com/viewtopic.php?pid=117565#p117565">хук</a>:</p><div class="codebox"><pre><code>CoordMode, ToolTip
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, Ptr)
   , UInt, 0, Ptr)
OnExit( Func(&quot;Exit&quot;).Bind(hHookKeybd) )
Return

Esc::ExitApp

Exit(hHookKeybd)  {
   DllCall(&quot;UnhookWindowsHookEx&quot;, Ptr, hHookKeybd)
}

LowLevelKeyboardProc(nCode, wParam, lParam)  {
   static lpData, size := VarSetCapacity(lpData, 16, 0)

   DllCall(&quot;RtlMoveMemory&quot;, Ptr, &amp;lpData, Ptr, lParam, Ptr, size)
   timer := Func(&quot;EventHandling&quot;).Bind(wParam, &amp;lpData)
   SetTimer, % timer, -10
   Return DllCall(&quot;CallNextHookEx&quot;, Ptr, 0, Int, nCode, Ptr, wParam, Ptr, lParam)
}

EventHandling(wp, lp)  {
   static oMsg := {0x100: &quot;WM_KEYDOWN&quot;, 0x101: &quot;WM_KEYUP&quot;, 0x104: &quot;WM_SYSKEYDOWN&quot;, 0x105: &quot;WM_SYSKEYUP&quot;}
        , oMembers := [&quot;vk&quot;, &quot;sc&quot;, &quot;flags&quot;, &quot;time&quot;]
        , oFlagOffsets := {LLKHF_EXTENDED: 0, LLKHF_LOWER_IL_INJECTED: 1, LLKHF_INJECTED: 4, LLKHF_ALTDOWN: 5, LLKHF_UP: 7}
      
        , oModifiersSC := { LCtrl: 0x1D , LShift: 0x2A , LAlt: 0x38
                          , RCtrl: 0x11D, RShift: 0x136, RAlt: 0x138 }
        , oModifiersPressed := {}

   msg := wp
   for k, v in oMembers
      %v% := NumGet(lp + (k - 1)*4, &quot;UInt&quot;)

   for k, v in oFlagOffsets
      %k% := (flags &gt;&gt; v) &amp; 1

   sc |= LLKHF_EXTENDED &lt;&lt; 8

   for k, v in oModifiersSC  {
      if (sc = v &amp;&amp; Modifier := true)  {
         if LLKHF_UP
            oModifiersPressed.Delete(k)
         else
            oModifiersPressed[k] := true
      }
   }
   
   if !(Modifier || LLKHF_UP)  {
      for k in oModifiersPressed
         ModifiersString .= (A_Index = 1 ? &quot;&quot; : &quot; + &quot;) . k
      
      if ModifiersString
         ToolTip, % &quot;Вы нажали &quot; . ModifiersString . &quot; + &quot; . GetEngKeyName(sc)
   }
}

GetEngKeyName(sc)  {
   static Cyr := &quot;ёйцукенгшщзхъфывапролджэячсмитьбю,.&quot;&quot;№;?:&quot;
        , Lat := &quot;``qwertyuiop[]asdfghjkl;&#039;zxcvbnm,.?/@#$&amp;^&quot;
   KeyName := GetKeyName( &quot;sc&quot; . Format(&quot;{:X}&quot;, sc) )

   threadId := DllCall(&quot;GetWindowThreadProcessId&quot;, Ptr, WinExist(&quot;A&quot;), UInt, 0, Ptr)
   landId := DllCall(&quot;GetKeyboardLayout&quot;, Ptr, threadId, Ptr) &amp; 0xFFFF
   if ( landId = 0x419 &amp;&amp; (n := InStr(Cyr, KeyName)) )
      KeyName := SubStr(Lat, n, 1)
   Return RegExReplace(KeyName, &quot;^(.)&quot;, &quot;$U1&quot;)
}</code></pre></div><p>Не думаю, что сильно прояснилось. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 25 Jul 2017 22:47:51 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117593#p117593</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117589#p117589</link>
			<description><![CDATA[<p><strong>teadrinker</strong> Отловить нужно любые клавиши с модификаторами ctrl, shift, alt. Но этого сделать как я понимаю не получится. Ну или не через input. Буду дальше руководство ковырять.</p>]]></description>
			<author><![CDATA[null@example.com (Viruzober)]]></author>
			<pubDate>Tue, 25 Jul 2017 17:59:34 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117589#p117589</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117587#p117587</link>
			<description><![CDATA[<p><strong>Viruzober</strong>, так я не пойму, вам нужно отловить какие-то конкретные клавиши с модификаторами, или вообще любые?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 25 Jul 2017 15:58:17 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117587#p117587</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117586#p117586</link>
			<description><![CDATA[<p><strong>Viruzober</strong>, кажется, там только на ctrl можно добавить нажатия клавиш. Может, кто-нибудь другой точно скажет, не знаю.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 25 Jul 2017 15:37:31 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117586#p117586</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117583#p117583</link>
			<description><![CDATA[<p><strong>svoboden</strong> Я имел в виду что-то такое.<br /></p><div class="codebox"><pre><code>Transform, lAltF, Chr, 6
Transform, CtrlF, Chr, 6
Transform, CtrlC, Chr, 3
Input, OutputVar, L1 M
if OutputVar = %CtrlF%
    MsgBox, Вы нажали Control-F.
else if OutputVar = %CtrlC%
    MsgBox, Вы нажали Control-C.
else if OutputVar = %lAltF%
    MsgBox, Вы нажали ShiftF.
ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Viruzober)]]></author>
			<pubDate>Tue, 25 Jul 2017 14:53:18 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117583#p117583</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117580#p117580</link>
			<description><![CDATA[<p><strong>Viruzober</strong>, так для левого alt будет: {lalt}. В справке же написано, что клавиши с модификаторами, не поддерживаются.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 25 Jul 2017 13:43:38 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117580#p117580</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117579#p117579</link>
			<description><![CDATA[<p><strong>svoboden</strong> И звените, я похоже туплю. Я имел в виду сделать обработку alt и shift. Я только что пробовал с alt, не получилось.</p>]]></description>
			<author><![CDATA[null@example.com (Viruzober)]]></author>
			<pubDate>Tue, 25 Jul 2017 13:29:18 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117579#p117579</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117577#p117577</link>
			<description><![CDATA[<p><strong>Viruzober</strong>, так:<br /></p><div class="codebox"><pre><code>Transform, CtrlF, Chr, 6
Input, OutputVar, M, {Enter}
if OutputVar = %CtrlF%
    MsgBox, Вы нажали Control-F.
ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 25 Jul 2017 13:24:53 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117577#p117577</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117576#p117576</link>
			<description><![CDATA[<p><strong>svoboden</strong> А не получится сделать клавиши с модификатором в andkey?</p>]]></description>
			<author><![CDATA[null@example.com (Viruzober)]]></author>
			<pubDate>Tue, 25 Jul 2017 13:10:43 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117576#p117576</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117575#p117575</link>
			<description><![CDATA[<p><strong>teadrinker</strong> Да вполне хорош. В руководстве подобный был. А с другими модификаторами не выйдет? Сейчас буду пробовать.</p>]]></description>
			<author><![CDATA[null@example.com (Viruzober)]]></author>
			<pubDate>Tue, 25 Jul 2017 12:52:34 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117575#p117575</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117574#p117574</link>
			<description><![CDATA[<p><strong>Viruzober</strong>, такой вариант годится?</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 25 Jul 2017 12:19:05 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117574#p117574</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117572#p117572</link>
			<description><![CDATA[<p><strong>teadrinker</strong>, вроде только на ctrl откликается. Вот пример с ctrl+f:</p><div class="codebox"><pre><code>Transform, CtrlF, Chr, 6
Input, OutputVar, L1 M
if OutputVar = %CtrlF%
    MsgBox, Вы нажали Control-F.
ExitApp</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 25 Jul 2017 10:50:20 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117572#p117572</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117571#p117571</link>
			<description><![CDATA[<p><strong>svoboden</strong>, а разве там не только с модификатором Ctrl? Сейчас с телефона, не могу поверить.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 25 Jul 2017 10:33:46 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117571#p117571</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link>http://forum.script-coding.com/viewtopic.php?pid=117570#p117570</link>
			<description><![CDATA[<p>Опция &quot;M&quot; же есть.</p>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Tue, 25 Jul 2017 10:17:42 +0000</pubDate>
			<guid>http://forum.script-coding.com/viewtopic.php?pid=117570#p117570</guid>
		</item>
	</channel>
</rss>
