<?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=18429&amp;type=atom" />
	<updated>2025-04-23T23:24:41Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18429</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162386#p162386" />
			<content type="html"><![CDATA[<p>Теперь все вопросы в одной теме будете задавать?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-04-23T23:24:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162386#p162386</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162384#p162384" />
			<content type="html"><![CDATA[<p>Как переделать ToolTip на SplashImage, поддерживаемый в v2? Испробовал кучу вариантов в том числе с GUI из справки и двух ИИ - всё с ошибками.</p><div class="codebox"><pre><code>#Requires AutoHotkey v2.0
#UseHook

^6:: {
    static toggle := false
    toggle := !toggle

    BlockInput(toggle)

    if (toggle) {
        ToolTip(&quot;BlockInput включен&quot;)
    } else {
        ToolTip(&quot;BlockInput выключен&quot;)
        Sleep(1000)
        ToolTip(&quot;&quot;)
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-23T22:46:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162384#p162384</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162379#p162379" />
			<content type="html"><![CDATA[<p>Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-23T14:01:28Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162379#p162379</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162378#p162378" />
			<content type="html"><![CDATA[<p>Пользуюсь таким костылем:<br /></p><div class="codebox"><pre><code>
~$END::
  if (A_TimeSincePriorHotkey &lt;= 200 &amp;&amp; A_PriorHotkey = &quot;~$END&quot;)
  {
    MouseGetPos,Lockx,Locky
    lockInput:=true
    BlockInput,on
    tooltip,Клавиатура и мышь заблокированны.`nВведите пароль и нажмите ввод чтобы разблокировать.
    loop,0x7F
    {
      if (a_index!=0x5E and !(a_index&gt;=0x3A and a_index&lt;=0x40) and a_index!=0x1A and a_index!=0x16 and a_index!=0x0A and a_index!=0x0B and a_index!=0x07)
        hotkey,% &quot;vk&quot; a_index,keyblock,On UseErrorLevel
    }
    settimer,MouseLock,50
  }
  return


#if lockInput
:*B0:пароль::
:*B0:gfhjkm::
  send,{alt up}{shift up}{ctrl up}{win up}
  tooltip
  loop,0x7F
    hotkey,% &quot;vk&quot; a_index,keyblock,Off UseErrorLevel
  BlockInput,off
  lockInput:=false
  settimer,MouseLock,off
  return
#if


keyblock:
  return


MouseLock:
MouseGetPos,DF_X,DF_Y
if (DF_X!=LockX or DF_Y!=LockY)
  Mousemove,Lockx,Locky
  return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alectric]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26027</uri>
			</author>
			<updated>2025-04-23T13:25:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162378#p162378</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162377#p162377" />
			<content type="html"><![CDATA[<p>Правильно понимаю, что переключатель в принципе не может работать на v1 с двойной клавишей?</p><p>Нашелся скрипт для v1, где в настройках можно задать хоткей и количество секунд до разблокировки после нажатия хоткея. Может ли он работать с переключателем по двойной клавише без секунд?<br /></p><div class="codebox"><pre><code>;BlockInput.ahk
; Temporarily block all input by pressing a hotkey
; To run, save to BlockInput.ahk and install AutoHotkey from www.autohotkey.com
;Skrommel @2006

#SingleInstance,Force

applicationname=BlockInput

Gosub,INI
Gosub,TRAYMENU
Return

HOTKEY:
Loop
{
  GetKeyState,shift,Shift,P
  GetKeyState,ctrl,Ctrl,P
  GetKeyState,alt,Alt,P
  If (shift=&quot;U&quot; And ctrl=&quot;U&quot; And alt=&quot;U&quot;)  
    Break
}

BlockInput,On
counter:=delay
Loop,%delay%
{
  ToolTip,BlockInput resumes in %counter% seconds
  counter-=1
  Sleep,1000
}
ToolTip
BlockInput,Off
Return

TRAYMENU:
Menu,Tray,NoStandard 
Menu,Tray,DeleteAll 
Menu,Tray,Add,%applicationname%,ABOUT
Menu,Tray,Add,
Menu,Tray,Add,&amp;Settings...,SETTINGS
Menu,Tray,Add,&amp;About...,ABOUT
Menu,Tray,Add,E&amp;xit,EXIT
Menu,Tray,Default,%applicationname%
Menu,Tray,Tip,%applicationname%
Return


SETTINGS:
HotKey,%hotkey%,Off
Gui,Destroy
Gui,Add,GroupBox,xm ym w400 h70,&amp;Hotkey
Gui,Add,Hotkey,xp+10 yp+20 w380 vshotkey
StringReplace,current,hotkey,+,Shift +%A_Space%
StringReplace,current,current,^,Ctrl +%A_Space%
StringReplace,current,current,!,Alt +%A_Space%
Gui,Add,Text,,Current hotkey: %current%
Gui,Add,GroupBox,xm y+20 w400 h50,&amp;Delay
Gui,Add,Edit,xp+10 yp+20 w380 vsdelay,%delay%
Gui,Add,Button,xm y+10 w75 GSETTINGSOK,&amp;OK
Gui,Add,Button,x+5 w75 GSETTINGSCANCEL,&amp;Cancel
Gui,Show,,%applicationname% Settings
Return

SETTINGSOK:
Gui,Submit
If shotkey&lt;&gt;
{
  hotkey:=shotkey
  HotKey,%hotkey%,HOTKEY
}
HotKey,%hotkey%,On
If sdelay&lt;&gt;
  delay:=sdelay
IniWrite,%hotkey%,%applicationname%.ini,Settings,hotkey
IniWrite,%delay%,%applicationname%.ini,Settings,delay
Return

SETTINGSCANCEL:
HotKey,%hotkey%,HOTKEY
HotKey,%hotkey%,On
Gui,Destroy
Return


INI:
IfNotExist,%applicationname%.ini
{
  IniWrite,^Q,%applicationname%.ini,Settings,hotkey
  IniWrite,5,%applicationname%.ini,Settings,delay
}
IniRead,hotkey,%applicationname%.ini,Settings,hotkey
IniRead,delay,%applicationname%.ini,Settings,delay
HotKey,%hotkey%,HOTKEY
HotKey,%hotkey%,On
Return



ABOUT:
Gui,Destroy
Gui,Margin,20,20
Gui,Add,Picture,xm Icon1,%applicationname%.exe
Gui,Font,Bold
Gui,Add,Text,x+10 yp+10,%applicationname% v1.0
Gui,Font
Gui,Add,Text,y+10,- Press Ctrl+Q to temporarily block all input.
Gui,Add,Text,y+10,- To change the settings, choose Settings in the tray menu.

Gui,Add,Picture,xm y+20 Icon2,%applicationname%.exe
Gui,Font,Bold
Gui,Add,Text,x+10 yp+10,1 Hour Software by Skrommel
Gui,Font
Gui,Add,Text,y+10,For more tools, information and donations, please visit 
Gui,Font,CBlue Underline
Gui,Add,Text,y+5 G1HOURSOFTWARE,www.1HourSoftware.com
Gui,Font

Gui,Add,Picture,xm y+20 Icon7,%applicationname%.exe
Gui,Font,Bold
Gui,Add,Text,x+10 yp+10,DonationCoder
Gui,Font
Gui,Add,Text,y+10,Please support the contributors at
Gui,Font,CBlue Underline
Gui,Add,Text,y+5 GDONATIONCODER,www.DonationCoder.com
Gui,Font

Gui,Add,Picture,xm y+20 Icon6,%applicationname%.exe
Gui,Font,Bold
Gui,Add,Text,x+10 yp+10,AutoHotkey
Gui,Font
Gui,Add,Text,y+10,This tool was made using the powerful
Gui,Font,CBlue Underline
Gui,Add,Text,y+5 GAUTOHOTKEY,www.AutoHotkey.com
Gui,Font

Gui,Add,Button,GABOUTOK Defaultw75,&amp;OK

Gui,Show,,%applicationname% About
hCurs:=DllCall(&quot;LoadCursor&quot;,&quot;UInt&quot;,NULL,&quot;Int&quot;,32649,&quot;UInt&quot;) ;IDC_HAND
OnMessage(0x200,&quot;WM_MOUSEMOVE&quot;) 
Return

1HOURSOFTWARE:
  Run,http://www.1hoursoftware.com,,UseErrorLevel
Return

DONATIONCODER:
  Run,http://www.donationcoder.com,,UseErrorLevel
Return

AUTOHOTKEY:
  Run,http://www.autohotkey.com,,UseErrorLevel
Return

ABOUTOK:
  Gui,Destroy
  OnMessage(0x200,&quot;&quot;)
  DllCall(&quot;DestroyCursor&quot;,&quot;Uint&quot;,hCur)
Return

WM_MOUSEMOVE(wParam,lParam)
{
  Global hCurs
  MouseGetPos,,,,ctrl
  If ctrl in Static8,Static12,Static16
    DllCall(&quot;SetCursor&quot;,&quot;UInt&quot;,hCurs)
  Return
}
Return


EXIT:
ExitApp

</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-23T11:03:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162377#p162377</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162373#p162373" />
			<content type="html"><![CDATA[<p>У меня работает только на AHK v2, и только, если запущено от Администратора.<br /></p><div class="codebox"><pre><code>#Requires AutoHotkey v2.0
#UseHook

^Esc:: {
    static toggle := false
    BlockInput toggle ^= 1
}</code></pre></div><p>На v1 блокировка не снимается, не знаю почему.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-04-22T22:09:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162373#p162373</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162372#p162372" />
			<content type="html"><![CDATA[<p>Спасибо. Хочу, чтобы по нажатии сочетания из двух клавиш, срабатывал переключатель блокировки мыши и ввода с клавиатуры в системе. Пробовал разные варианты сочетаний с модификатором и без, но при этом ожидаемый функционал по блокировке не срабатывает. В том числе:<br /></p><div class="codebox"><pre><code>$Ctrl &amp; sc1::  ;Ctrl + Esc</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-22T18:35:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162372#p162372</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162371#p162371" />
			<content type="html"><![CDATA[<p>Если бы вы объяснили все по порядку, какого поведения вы хотите, какие способы пробовали и в чём были проблемы, тогда отвечающим было бы проще. Изначальный вопрос выглядит так, будто вы не знаете, как задавать клавиши с модификатором, и спрашиваете здесь вместо того, чтобы просто заглянуть в справку.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-04-22T00:37:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162371#p162371</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162370#p162370" />
			<content type="html"><![CDATA[<p>Блокировку ввода клавиш и движений мыши.</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-22T00:08:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162370#p162370</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162369#p162369" />
			<content type="html"><![CDATA[<p>Не понимаю, какую блокировку вы имеете в виду и при чём тут перезагрузка компьютера.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-04-21T23:15:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162369#p162369</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162368#p162368" />
			<content type="html"><![CDATA[<p>Просто я пробовал и вот так -<br /></p><div class="codebox"><pre><code>Ctrl &amp; Esc</code></pre></div><p>и так -<br /></p><div class="codebox"><pre><code>^Esc</code></pre></div><p>Но потом приходилось перезагружать компьютер и блокировка как надо не работает. Видимо, необходим хоткей с символом - $.</p>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-21T22:45:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162368#p162368</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162367#p162367" />
			<content type="html"><![CDATA[<p>Вам ссылку на справку, или на ChatGPT?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-04-21T22:42:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162367#p162367</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Заблокировать клавиатуру и мышь]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162366#p162366" />
			<content type="html"><![CDATA[<p>Следующий скрипт переключает блокировку клавиатуры и мыши одной клавишей F1. Как задать сочетание из двух клавиш, например - &quot;Ctrl+Esc&quot;?<br /></p><div class="codebox"><pre><code>BlockInput, on
SplashImage,, W500 H100 B1 FM20 CW0FFf0f CWffFf0f,, F1 — чтобы разблокировать `nклавиатуру и мышь,, Arial ;yellow
Return

$F1::  ;Num Lock
   BlockInput, off
   SplashImage, OFF
   ExitApp
return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-04-21T22:12:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162366#p162366</id>
		</entry>
</feed>
