<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Space как Shift]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15564&amp;type=atom" />
	<updated>2020-07-30T10:01:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15564</id>
		<entry>
			<title type="html"><![CDATA[AHK: Space как Shift]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=141278#p141278" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[mkone112]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40951</uri>
			</author>
			<updated>2020-07-30T10:01:31Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=141278#p141278</id>
		</entry>
</feed>
