<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Space как Shift]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=15564</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15564&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Space как Shift».]]></description>
		<lastBuildDate>Thu, 30 Jul 2020 10:01:31 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[AHK: Space как Shift]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=141278#p141278</link>
			<description><![CDATA[<p>Что-то не могу придумать как повесить на Space функции Shift, со следующим поведением:<br />{Space Down}{Key Down}{Key Up} посылает shift + Key<br />{Space Down}{Key Down}{Space Up}{Key Up} посылает {Space}{Key},<br />где Key - клавиши символов и F1-F12.</p><p>UPD:<br />Концепт:<br /></p><div class="codebox"><pre><code>#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

$Space::
    KeyWait, Space
    if (A_PriorKey == &quot;Space&quot;)
        Send {Space}
    else
    {
        Loop, 256
        {
                key_with_space := Format(&quot;vk{:x}&quot;, A_Index-1)
                if GetKeyState(key_with_space,&quot;P&quot;)
                    Send {Space}
        }
    }
return

#if GetKeyState(&quot;Space&quot;, &quot;P&quot;)
$VK51::
$VK57::
$VK46::
$VK50::
$VK47::
$VK4A::
$VK4C::
$VK55::
$VK59::
$VKBA::
$VKDB::
$VKDD::
$VKDC::
$VK41::
$VK52::
$VK53::
$VK54::
$VK44::
$VK48::
$VK4E::
$VK45::
$VK49::
$VK4F::
$VKDE::
$VK5A::
$VK58::
$VK43::
$VK56::
$VK42::
$VK4B::
$VK4D::
$VKBC::
$VKBE::
$VKBF::
    key := SubStr(A_ThisHotkey,2)
    while GetKeyState(&quot;Space&quot;, &quot;P&quot;) &amp;&amp; GetKeyState(key, &quot;P&quot;)
        sleep 30
    if GetKeyState(&quot;Space&quot;, &quot;P&quot;)
    {
        send +{%key%}
    }
    else
    {
    keywait %key%
    send {Space}
    sleep 30
    send {%key%}
    }
return
#if</code></pre></div><p>Можно ли написать это как-то изящней?</p>]]></description>
			<author><![CDATA[null@example.com (mkone112)]]></author>
			<pubDate>Thu, 30 Jul 2020 10:01:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=141278#p141278</guid>
		</item>
	</channel>
</rss>
