<?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=11934&amp;type=atom" />
	<updated>2016-08-23T15:22:22Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11934</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не рабочий скрипт жестов и пара вопросов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106998#p106998" />
			<content type="html"><![CDATA[<p>Вот <a href="http://www.jouse.com/jouse3/home">такая</a> штука у меня. Шея работает, но пока в ошейнике. Слабо работает рука правая до кисти.<br />Голос есть, и знаю про пару программ, но у меня слабый голос и программы плохо распознают, увы.</p><p><strong>wisgest</strong> ещё раз благодарю. С заменой заработало.</p>]]></content>
			<author>
				<name><![CDATA[Larec]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34139</uri>
			</author>
			<updated>2016-08-23T15:22:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106998#p106998</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не рабочий скрипт жестов и пара вопросов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106997#p106997" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Larec пишет:</cite><blockquote><p>Была поставлена по умолчанию 64-х битная АНК. Переустановил 32-ух и заработало.</p></blockquote></div><p>Вероятно, заработало бы и с AHK64, если бы кое-где в DllCall исправить 32-разрядный тип UInt на учитывающий разрядность Ptr.<br />Мне не на чем проверить, т.к. ОС 32-разрядная, но формально-умозрительно надо строки<br /></p><div class="codebox"><pre><code>      MMHK_hHookMouse  := DllCall(&quot;SetWindowsHookEx&quot;, &quot;int&quot;, MMHK_idHook, &quot;Uint&quot;, MMHK_pfn, &quot;Uint&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;Uint&quot;, 0), &quot;Uint&quot;, 0)</code></pre></div><div class="codebox"><pre><code>         Return DllCall(&quot;UnhookWindowsHookEx&quot;, &quot;Uint&quot;, MMHK_hHookStatic)</code></pre></div><div class="codebox"><pre><code>   MMHK_NH := DllCall(&quot;CallNextHookEx&quot;, &quot;Uint&quot;, 0, &quot;int&quot;, MMHK_nCode, &quot;Uint&quot;, MMHK_wParam, &quot;Uint&quot;, MMHK_lParam)</code></pre></div><p>исправить на<br /></p><div class="codebox"><pre><code>      MMHK_hHookMouse  := DllCall(&quot;SetWindowsHookEx&quot;, &quot;int&quot;, MMHK_idHook, &quot;Ptr&quot;, MMHK_pfn, &quot;Ptr&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;Ptr&quot;, 0, &quot;Ptr&quot;), &quot;Uint&quot;, 0, &quot;Ptr&quot;)</code></pre></div><div class="codebox"><pre><code>         Return DllCall(&quot;UnhookWindowsHookEx&quot;, &quot;Ptr&quot;, MMHK_hHookStatic)</code></pre></div><div class="codebox"><pre><code>   MMHK_NH := DllCall(&quot;CallNextHookEx&quot;, &quot;Ptr&quot;, 0, &quot;int&quot;, MMHK_nCode, &quot;Ptr&quot;, MMHK_wParam, &quot;Ptr&quot;, MMHK_lParam)</code></pre></div><p>Для второго вопроса лучше создать отдельную тему.</p>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2016-08-23T14:43:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106997#p106997</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не рабочий скрипт жестов и пара вопросов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106995#p106995" />
			<content type="html"><![CDATA[<p><strong>Larec</strong>, это у Вас такая специальная мышка для рта?<br />Вращать головой (в смысле шеей) можете?<br />И ещё вопрос - разговаривать голосом можете?</p>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2016-08-23T14:23:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106995#p106995</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не рабочий скрипт жестов и пара вопросов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106993#p106993" />
			<content type="html"><![CDATA[<p>Была поставлена по умолчанию 64-х битная АНК. Переустановил 32-ух и заработало. Влияет это на производительность? Или всё равно АНК не использует таких объёмов памяти?</p><p>Спасибо за редактирование скрипта.&nbsp; Немного поправил под себя. Привыкаю.</p><p>По поводу 2 вопроса. Поковырявшись немного, думаю такого круга не получить. Можете подсказать как сделать так что бы при Средний кнопке мыши открывался ГУЙ с 4-мя кнопками, вокруг центра нажатия.</p>]]></content>
			<author>
				<name><![CDATA[Larec]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34139</uri>
			</author>
			<updated>2016-08-23T10:50:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106993#p106993</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не рабочий скрипт жестов и пара вопросов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106992#p106992" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Larec пишет:</cite><blockquote><p>Есть ли возможность в <a href="http://hp.vector.co.jp/authors/VA018351/mglahk.html">подобных</a> скриптах назначить отправку клавиш только при движении мыши без нажатия кнопок. &lt;…&gt; Пример веду курсор влево отправляется А, вправо D и т.д.</p></blockquote></div><p>Что там по-японски — не знаю, а если использовать упомянутый в этой теме MMHK.ahk, то:<br /></p><div class="codebox"><pre><code>OnExit, MMHK_OnExit ; работает и без этой строки
MMHK_Start()
MMHK_TriggerLength := 50 ; как я понял, чуствительность в пикселах
return
#include MMHK.ahk

left:
	Send A
	return
right:
	Send D
	return
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2016-08-23T10:37:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106992#p106992</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Не рабочий скрипт жестов и пара вопросов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106990#p106990" />
			<content type="html"><![CDATA[<p>У меня работает. Надо только или убрать строку </p><div class="codebox"><pre><code>#Include MMHK.ahk</code></pre></div><p>, или часть кода начиная со строки </p><div class="codebox"><pre><code>; MMHK.ahk - Mouse Movement HotKeys (Release 2)</code></pre></div><p> перенести в отдельный файл MMHK.ahk.</p>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2016-08-23T10:07:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106990#p106990</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Не рабочий скрипт жестов и пара вопросов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=106988#p106988" />
			<content type="html"><![CDATA[<p>Доброго времени суток. Имеется скрипт жестов мыши, на форуме, вроде, никто не жаловался. Подскажите, пожалуйста, почему он не работает.<br /></p><div class="codebox"><pre><code>DemoText =
(
-- MMHK-Demo 4 --

check out the Tooltip!
It displays the current direction of the mouse movement.
)

OnExit, MMHK_OnExit
MMHK_Start()
MMHK_TriggerLength := 3
MsgBox, %Demotext%
return
#Include MMHK.ahk

MMHK_AllOtherMovements:
CoordMode, ToolTip, Screen
ToolTip , Vector: %MMHK_CurrentVector%`nDirection: %MMHK_CurrentDirection%, 5, 5, 2
return

; MMHK.ahk - Mouse Movement HotKeys (Release 2)
; by Zed_Gecko (using a Mouse-Hook made by Sean)
; MMHK allows you to create hotkey-like labels for mouse movements.
; You can assign actions to any combination of
; Mouse-Movements (8 directions supported)
; &amp; Prefix-Key (Win, Ctrl, Alt, Shift)
; &amp; MouseButton (Left, Middle, Right)
;  -- ATTENTION! --
; Don´t include in the auto-execute section
;  -- USAGE --
; use MMHK_Start() to init Mouse Movement Hotkeys
; call MMHK_Stop() before closing the script
; u can use OnExit, MMHK_OnExit in your Script instead
; -- supported &quot;HotKey&quot;-Labels --
;u can use the Mouse Movement labels (almost) like usual hotkeys:
; e.g.:
; up:
; up_right:
; right:
; down_right:
; down:
; down_left:
; left:
; up_left:
; LButton_up:
; LButton_up_left:
; RButton_up:
; MButton_up:
; LButton_RButton_up:
; LButton_RButton_MButton_up:
; #up:
; !up:
; ^up:
; +up:
; !^LButton_up:
; #!^+LButton_RButton_MButton_up_left:
;
; basicly all combinations of Movement, Mouse-Button and Modifier-Key will work, but
; the need to be written in the right order.
; The order is: # ! ^ + LButton_ RButton_ MButton_ [direction]
; all Mouse-Buttons must have the &quot;_&quot; at the end, the Modifer-Symbols must not.
; in addition you can use
; MMHK_AllOtherMovements:
; thisLabel will be called if there is no Mouse Movement label for the current action.
; -- usefull VARIABLES --
;  MMHK_TriggerLength  -&gt; the amount of Pixels the mouse must move to trigger a Mouse Movement HotKey
;                         u can change it´s value to any thing between 3 and 1000, default is 100
;  MMHK_ThisHotkey  -&gt; The Label of the Mouse Movement HotKey that is currently detected, even if not defined
;  MMHK_PrevHotkey  -&gt; The Label of the Mouse Movement HotKey that was detected before the currently detected one.
;  MMHK_PrePrevHotkey  -&gt; The Label of the Mouse Movement HotKey that was detected before MMHK_PrevHotkey
;  MMHK_PrePrePrevHotkey  -&gt; The Label of the Mouse Movement HotKey that was detected before MMHK_PrePrevHotkey
;  MMHK_PrePrePrePrevHotkey  -&gt; The Label of the Mouse Movement HotKey that was detected before MMHK_PrePrePrevHotkey
;  MMHK_CurrentDirection  -&gt; The direction of the current mouse movement. e.g. &quot;up&quot; or &quot;down_left&quot;
;  MMHK_CurrentVector  -&gt; The direction of the current mouse movement in radians. (a float between -pi &amp; +pi. 0 is left, -pi &amp; +pi is right)
#Persistent
return


MMHK_OnExit:
MMHK_Stop()
ExitApp
return


MMHK_HotKeyHandler:
MMHK_HandlerActive = Off
MMHK_HotKeyHandlerFunc()
MMHK_HandlerActive := -1
return


MMHK_Start()
{
   MMHK_idHook := 14
   MMHK_pfn := RegisterCallback(&quot;MMHK_MouseMove&quot;, &quot;Fast&quot;)
      MMHK_hHookMouse  := DllCall(&quot;SetWindowsHookEx&quot;, &quot;int&quot;, MMHK_idHook, &quot;Uint&quot;, MMHK_pfn, &quot;Uint&quot;, DllCall(&quot;GetModuleHandle&quot;, &quot;Uint&quot;, 0), &quot;Uint&quot;, 0)
   MMHK_Stop(MMHK_hHookMouse)
      Return MMHK_hHookMouse
}


MMHK_Stop(MMHK_hHook = &quot;off&quot;)
{
   static MMHK_hHookStatic
   if (MMHK_hHook != &quot;off&quot;)
   {
      MMHK_hHookStatic := MMHK_hHook
      Return MMHK_hHookStatic
   }
   else
         Return DllCall(&quot;UnhookWindowsHookEx&quot;, &quot;Uint&quot;, MMHK_hHookStatic)
}


MMHK_MouseMove(MMHK_nCode, MMHK_wParam, MMHK_lParam)
{
   MMHK_NH := DllCall(&quot;CallNextHookEx&quot;, &quot;Uint&quot;, 0, &quot;int&quot;, MMHK_nCode, &quot;Uint&quot;, MMHK_wParam, &quot;Uint&quot;, MMHK_lParam)
   global MMHK_HandlerActive
   If !MMHK_nCode &amp;&amp; (MMHK_wParam = 0x200)
   {
         SetTimer, MMHK_HotKeyHandler, %MMHK_HandlerActive%
   }
   Return MMHK_NH
}


MMHK_HotKeyHandlerFunc()
{
   static MMHK_OldX, MMHK_OldY, MMHK_Hotkey, MMHK_HKLength, MMHK_THK, MMHK_PHK, MMHK_PPHK, MMHK_PPPHK, MMHK_PPPPHK, MMHK_PI := 3.141592653589793
   global MMHK_TriggerLength, MMHK_CurrentVector, MMHK_CurrentDirection ,MMHK_ThisHotkey, MMHK_PrevHotkey, MMHK_PrePrevHotkey, MMHK_PrePrePrevHotkey, MMHK_PrePrePrePrevHotkey
   CoordMode, Mouse, Screen
   MouseGetPos, MMHK_X, MMHK_Y
   MMHK_NewKeys =
   if GetKeyState(&quot;LWin&quot;) || GetKeyState(&quot;RWin&quot;)
      MMHK_NewKeys .= &quot;#&quot;
   if GetKeyState(&quot;LAlt&quot;) || GetKeyState(&quot;RAlt&quot;)
      MMHK_NewKeys .= &quot;!&quot;
   if GetKeyState(&quot;LControl&quot;) || GetKeyState(&quot;RControl&quot;)
      MMHK_NewKeys .= &quot;^&quot;      
   if GetKeyState(&quot;LShift&quot;) || GetKeyState(&quot;RShift&quot;)
      MMHK_NewKeys .= &quot;+&quot;
   if GetKeyState(&quot;LButton&quot;)
      MMHK_NewKeys .= &quot;LButton_&quot;      
   if GetKeyState(&quot;RButton&quot;)
      MMHK_NewKeys .= &quot;RButton_&quot;
   if GetKeyState(&quot;MButton&quot;)
      MMHK_NewKeys .= &quot;MButton_&quot;   
   MMHK_XDiff := MMHK_X - MMHK_OldX
   MMHK_YDiff := MMHK_Y - MMHK_OldY
   MMHK_OldX := MMHK_X
   MMHK_OldY := MMHK_Y
   MMHK_Distance := ( ((MMHK_XDiff) ** 2) + ((MMHK_YDiff) ** 2) ) ** 0.5
   MMHK_Vector := ( ASin( MMHK_XDiff / MMHK_Distance ) + (MMHK_PI / 2) ) * ( (MMHK_YDiff &lt; 0) ? 1 : -1)
   MMHK_NewDir =
   loop, 1
   {
      if ( MMHK_Vector &gt; (7 / 8 * MMHK_PI)) || ( MMHK_Vector &lt; (7 / 8 * MMHK_PI * -1))
      {
         MMHK_NewDir = right
         break
      }
      if ( MMHK_Vector &gt; (5 / 8 * MMHK_PI))
      {
         MMHK_NewDir = up_right
         break
      }
      if ( MMHK_Vector &gt; (3 / 8 * MMHK_PI))
      {
         MMHK_NewDir = up
         break
      }
      if ( MMHK_Vector &gt; (1 / 8 * MMHK_PI))
      {
         MMHK_NewDir = up_left
         break
      }
      if ( MMHK_Vector &gt; (1 / 8 * MMHK_PI * -1))
      {
         MMHK_NewDir = left
         break
      }
      if ( MMHK_Vector &gt; (3 / 8 * MMHK_PI * -1))
      {
         MMHK_NewDir = down_left
         break
      }
      if ( MMHK_Vector &gt; (5 / 8 * MMHK_PI * -1))
      {
         MMHK_NewDir = down
         break
      }
      MMHK_NewDir = down_right
   }
   MMHK_NewHotkey := MMHK_NewKeys . MMHK_NewDir
   if ( MMHK_NewHotkey = MMHK_Hotkey )
      MMHK_HKLength += MMHK_Distance
   else
   {
      MMHK_Hotkey := MMHK_NewHotkey
      MMHK_HKLength := MMHK_Distance
   }
   if ((MMHK_TriggerLength &lt; 3) || (MMHK_TriggerLength &gt; 1000))
   {
      MMHK_TriggerLength := 100
   }
   MMHK_CurrentVector := MMHK_Vector
   MMHK_CurrentDirection := MMHK_NewDir
   if ( MMHK_HKLength &gt; MMHK_TriggerLength )
   {
      MMHK_HKLength := 0
      MMHK_PPPPHK := MMHK_PPPHK
      MMHK_PPPHK := MMHK_PPHK
      MMHK_PPHK := MMHK_PHK
      MMHK_PHK := MMHK_THK
      MMHK_THK := MMHK_Hotkey
      MMHK_PrePrePrePrevHotkey := MMHK_PPPPHK
      MMHK_PrePrePrevHotkey := MMHK_PPPHK
      MMHK_PrePrevHotkey := MMHK_PPHK
      MMHK_PrevHotkey := MMHK_PHK
      MMHK_ThisHotkey := MMHK_THK
      if IsLabel(MMHK_Hotkey)
      {
         SetTimer, %MMHK_Hotkey%, -1
      }
      else
      {
         MMHK_AOM := &quot;MMHK_AllOtherMovements&quot;
         if IsLabel(MMHK_AOM)
         {
            SetTimer, %MMHK_AOM%, -1
         }
      }   
   }
}</code></pre></div><p>Ссылку оригинального скрипта из <a href="https://autohotkey.com/board/topic/34753-mouse-movement-hotkeys-simple-mouse-gestures/">темы</a> на форуме удалили. Возможно, этот скрипт уже был изменён.</p><p>Лирическое отступление. Я инвалид первой группы, работает только голова. Мышь у меня во рту с тремя кнопками и колесом. Других клавиш нажимать для меня не возможно. Жесты очень сильно расширяют мои возможности. И недавно начал знакомится с АНK, ввиду того что даёт контролируемые возможности управления в отличии от готовых программ таких как ComfortKeys, StrokesPlus и подобных.</p><p>И вот несколько вопросов уважаемым гуру:<br />1. Есть ли возможность в <a href="http://hp.vector.co.jp/authors/VA018351/mglahk.html">подобных</a> скриптах назначить отправку клавиш только при движении мыши без нажатия кнопок. Как я понимаю все подобные программы и скрипты сохраняют переменные при нажатии и со временем сравнивают. Можно ли избежать этого? Пример веду курсор влево отправляется А, вправо D и т.д.</p><p>2. Есть ли возможность открывать Гуй с кнопками в зависимости от приложений при нажатие колеса в таком виде <span class="postimg"><img src="http://savepic.ru/11049805.jpg" alt="http://savepic.ru/11049805.jpg" /></span> <br />от центра нажатия, при этом сохраняя посыл самой кнопки колеса.</p>]]></content>
			<author>
				<name><![CDATA[Larec]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=34139</uri>
			</author>
			<updated>2016-08-23T04:45:03Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=106988#p106988</id>
		</entry>
</feed>
