<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Баг с залипанием клавиш]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7628&amp;type=atom" />
	<updated>2012-09-26T05:07:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7628</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Баг с залипанием клавиш]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64219#p64219" />
			<content type="html"><![CDATA[<p>На первый взгляд - помогло!<br />Благодарю.<br />Будем тестировать дальше.</p>]]></content>
			<author>
				<name><![CDATA[astira]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28579</uri>
			</author>
			<updated>2012-09-26T05:07:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64219#p64219</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Баг с залипанием клавиш]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64205#p64205" />
			<content type="html"><![CDATA[<p>Команды Send очень дружелюбны к пользователю, стараются «сделать как надо» несмотря ни на что.<br /></p><div class="quotebox"><blockquote><p>Кто-нибудь может объяснить, как это происходит</p></blockquote></div><p>Вызов процедур в которых выполняется команда Send вы производите при нажатии сочетания клавиш.<br />В момент выполнения команды Send вы, вероятно, еще не отпустили модификаторы используемые в данном сочетании.<br />Send перед «вводом какого-то текста» «отжимает» зажатые модификаторы, чтоб, если в тексте содержатся символы отправить которые можно эмулируя нажатия клавиш, нажатия не воспринимались как системные сочетания «модификатор + клавиша».<br />Возможно, система не всегда корректно воспринимает «отжатие» модификаторов alt, win и прочих.<br />Решением проблемы будет выполнять требуемые процедуры при отпускании всех модификаторов, используемых в горячей клавише.<br />Например:<br /></p><div class="codebox"><pre><code>#!r up::
    KeyWait, Lwin
    KeyWait, Rwin
    KeyWait, alt
    ; …</code></pre></div>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-09-25T13:53:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64205#p64205</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Баг с залипанием клавиш]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64189#p64189" />
			<content type="html"><![CDATA[<p>Имеется следующий код, который вставляет макросы в Confluence при нажатии сочетаний клавиш.</p><div class="codebox"><pre><code>SaveSelectedTextAndOpenWikiDialog()
{
	global tCl
	tCl := Clipboard	
	Sleep, 50
	Send, {CTRLDOWN}{vk58}{CTRLUP}
	Send, {CTRLDOWN}{SHIFTDOWN}{vk44}{SHIFTUP}{CTRLUP}
}

CloseWikiDialogAndRestoreClipboard()
{
	global tCl
	Send, {Tab}	
	Send, {Enter}
	Clipboard := tCl
}

WikiConfHotKey(FirstWikiTag, SecondWikiTag = &quot;&quot;)
{
	SaveSelectedTextAndOpenWikiDialog()
	SendInput %FirstWikiTag%
	SendInput {Enter}
	if SecondWikiTag &lt;&gt;
	{
		SendInput %SecondWikiTag%
		SendInput {Enter}
	}
	Send {CTRLDOWN}{vk56}{CTRLUP}
	SendInput {Enter}
	if SecondWikiTag &lt;&gt;			
	{
		SendInput %SecondWikiTag%
		SendInput {Enter}
	}
	SendInput %FirstWikiTag%
	SendInput {Enter}
	CloseWikiDialogAndRestoreClipboard()
	return 
}

#!q::
WikiConfHotKey(&quot;{Raw}{quote}&quot;)
return 

#!e::
WikiConfHotKey(&quot;{Raw}{expand}&quot;)
return 

#!c::
WikiConfHotKey(&quot;{Raw}{code}&quot;)
return 

#!n::
WikiConfHotKey(&quot;{Raw}{note}&quot;)
return 

#!i::
WikiConfHotKey(&quot;{Raw}{info}&quot;)
return 

#!t::
WikiConfHotKey(&quot;{Raw}{tip}&quot;)
return 

#!w::
WikiConfHotKey(&quot;{Raw}{warning}&quot;)
return 

#!p::
WikiConfHotKey(&quot;{Raw}{panel}&quot;)
return 

#!a::
	SaveSelectedTextAndOpenWikiDialog()
	SendInput, {Raw}{anchor:%Clipboard%}
	;
	CloseWikiDialogAndRestoreClipboard()
return 


#!r::
	SaveSelectedTextAndOpenWikiDialog()
	SendInput {Raw}{expand:Код PB}
	SendInput {Enter}

	SendInput {Raw}{code:lang=javascript}
	SendInput {Enter}

	Send {CTRLDOWN}{vk56}{CTRLUP}
	SendInput {Enter}
	SendInput {Raw}{code}
	SendInput {Enter}
	SendInput {Raw}{expand}
	SendInput {Enter}
	CloseWikiDialogAndRestoreClipboard()
return

#!l::
	SaveSelectedTextAndOpenWikiDialog()
	SendInput, {Raw}[%Clipboard%|%tCl%#%Clipboard%]
	CloseWikiDialogAndRestoreClipboard()
return</code></pre></div><p>Иногда творится какая-то билеберда. <br />Например, блокируется пользователь (Win+L). Браузер реагирует, как будто пытались закрыть окно.</p><p>Я добавил следующий хоткей.<br /></p><div class="codebox"><pre><code>
*F12::
	MsgBox, % &quot;LShift = &quot; GetKeyState(&quot;LShift&quot;, &quot;P&quot;) &quot;`nLWin  = &quot; GetKeyState(&quot;LWin&quot;, &quot;P&quot;)  &quot;`nLCtrl   = &quot; GetKeyState(&quot;LCtrl&quot;, &quot;P&quot;) &quot;`nLAlt    = &quot; GetKeyState(&quot;LAlt&quot;, &quot;P&quot;)
	Return</code></pre></div><p>Иногда в окне показывается, что, например, Alt или LWin зажаты.</p><p>Кто-нибудь может объяснить, как это происходит? Заранее большое спасибо.</p>]]></content>
			<author>
				<name><![CDATA[astira]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28579</uri>
			</author>
			<updated>2012-09-25T10:09:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64189#p64189</id>
		</entry>
</feed>
