<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Использование клавиш с модификаторами в input.]]></title>
	<link rel="self" href="http://forum.script-coding.com/extern.php?action=feed&amp;tid=12847&amp;type=atom" />
	<updated>2017-07-26T02:47:09Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.script-coding.com/viewtopic.php?id=12847</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117594#p117594" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> О то что надо, спасибо огромное. Вроде вьехал.</p>]]></content>
			<author>
				<name><![CDATA[Viruzober]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34705</uri>
			</author>
			<updated>2017-07-26T02:47:09Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117594#p117594</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117593#p117593" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-07-25T22:47:51Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117593#p117593</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117589#p117589" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Отловить нужно любые клавиши с модификаторами ctrl, shift, alt. Но этого сделать как я понимаю не получится. Ну или не через input. Буду дальше руководство ковырять.</p>]]></content>
			<author>
				<name><![CDATA[Viruzober]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34705</uri>
			</author>
			<updated>2017-07-25T17:59:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117589#p117589</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117587#p117587" />
			<content type="html"><![CDATA[<p><strong>Viruzober</strong>, так я не пойму, вам нужно отловить какие-то конкретные клавиши с модификаторами, или вообще любые?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-07-25T15:58:17Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117587#p117587</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117586#p117586" />
			<content type="html"><![CDATA[<p><strong>Viruzober</strong>, кажется, там только на ctrl можно добавить нажатия клавиш. Может, кто-нибудь другой точно скажет, не знаю.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-07-25T15:37:31Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117586#p117586</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117583#p117583" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Viruzober]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34705</uri>
			</author>
			<updated>2017-07-25T14:53:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117583#p117583</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117580#p117580" />
			<content type="html"><![CDATA[<p><strong>Viruzober</strong>, так для левого alt будет: {lalt}. В справке же написано, что клавиши с модификаторами, не поддерживаются.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-07-25T13:43:38Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117580#p117580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117579#p117579" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong> И звените, я похоже туплю. Я имел в виду сделать обработку alt и shift. Я только что пробовал с alt, не получилось.</p>]]></content>
			<author>
				<name><![CDATA[Viruzober]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34705</uri>
			</author>
			<updated>2017-07-25T13:29:18Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117579#p117579</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117577#p117577" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-07-25T13:24:53Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117577#p117577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117576#p117576" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong> А не получится сделать клавиши с модификатором в andkey?</p>]]></content>
			<author>
				<name><![CDATA[Viruzober]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34705</uri>
			</author>
			<updated>2017-07-25T13:10:43Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117576#p117576</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117575#p117575" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong> Да вполне хорош. В руководстве подобный был. А с другими модификаторами не выйдет? Сейчас буду пробовать.</p>]]></content>
			<author>
				<name><![CDATA[Viruzober]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34705</uri>
			</author>
			<updated>2017-07-25T12:52:34Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117575#p117575</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117574#p117574" />
			<content type="html"><![CDATA[<p><strong>Viruzober</strong>, такой вариант годится?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-07-25T12:19:05Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117574#p117574</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117572#p117572" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-07-25T10:50:20Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117572#p117572</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117571#p117571" />
			<content type="html"><![CDATA[<p><strong>svoboden</strong>, а разве там не только с модификатором Ctrl? Сейчас с телефона, не могу поверить.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2017-07-25T10:33:46Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117571#p117571</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Использование клавиш с модификаторами в input.]]></title>
			<link rel="alternate" href="http://forum.script-coding.com/viewtopic.php?pid=117570#p117570" />
			<content type="html"><![CDATA[<p>Опция &quot;M&quot; же есть.</p>]]></content>
			<author>
				<name><![CDATA[svoboden]]></name>
				<uri>http://forum.script-coding.com/profile.php?id=34280</uri>
			</author>
			<updated>2017-07-25T10:17:42Z</updated>
			<id>http://forum.script-coding.com/viewtopic.php?pid=117570#p117570</id>
		</entry>
</feed>
