Минимальная версия пилота 2.41.
Архив
luaPlugins.zip ( 314,41 килобайт )
Кол-во скачиваний: 1833
распаковать и положить в папку с пилотом.
Синтаксис (lua):
--lua
do
local back = package.path
package.path = "luaPlugins\\winapi\\?.lua;"..package.path
setfenv(1, require'winapi')
require[[winapi.keyboard]]
package.path = back
end
-- Получаем состояние клавиши:
-- state - нажата/отжата
-- toggle - для лампочек горит/не горит.
local state, toggle = GetKeyState(0x14)
log(tostring(state),tostring(toggle))
--lua
do
local back = package.path
package.path = "luaPlugins\\winapi\\?.lua;"..package.path
setfenv(1, require'winapi')
require[[winapi.keyboard]]
package.path = back
end
-- проверка нажата ли клавиша Z
while 1 do
local state = GetKeyState(90) -- или GetKeyState(0x5A)
if state then
log ("Z нажата")
else
log ("Z не нажата")
end
wait (100)
end
--lua
do
local back = package.path
package.path = "luaPlugins\\winapi\\?.lua;"..package.path
setfenv(1, require'winapi')
require[[winapi.keyboard]]
package.path = back
end
-- проверка включен ли CapsLock
while 1 do
local state, toggle = GetKeyState(0x14) -- или GetKeyState(20)
if toggle then
log ("CapsLock включен")
else
log ("CapsLock выключен")
end
wait (100)
end
--lua
do
local back = package.path
package.path = "luaPlugins\\winapi\\?.lua;"..package.path
setfenv(1, require'winapi')
require[[winapi.keyboard]]
package.path = back
end
log "clear" log "mode compact"
-- Дождаться нажатия клавиши Y
while 1 do
log ("Ждём когда будет нажата клавиша Y")
local state, toggle = GetKeyState(0x59)
while not state do
state, toggle = GetKeyState(0x59)
wait (10)
end
log ("Клавиша Y была нажата")
log ("Ждём когда будет отпущена клавиша Y")
while state do
state, toggle = GetKeyState(0x59)
wait (10)
end
log()
wait (10)
end
// если нажата клавиша q, выполнить какие-то действия
// в данном случае вывести в лог сообщение
if KB.GetKeyState(q) = 1
log Нажата клавиша q
end_if
wait 200
if KB.GetKeyStateByCode(65) = 1
log Нажата клавиша A
end_if
wait 200
// Проверить не нажата ли любая цифра
for #i 48 57
if KB.GetKeyStateByCode(#i) = 1
log Нажата цифра chr(#i)
end_if
end_for
wait 200
// Ожидание нажатия клавиши
log Для продолжения нажать клавишу Y
while KB.GetKeyState(y) = 0
wait 100
end_while
log Нажата клавиша Y
end_script
// Проверка нажатия кнопок мыши
if KB.GetKeyStateByCode(1) = 1
log Нажата левая кнопка мыши
end_if
if KB.GetKeyStateByCode(2) = 1
log Нажата правая кнопка мыши
end_if
wait 100
--lua
require("Kbd") -- загрузка функции
while 1 do -- бесконечный цикл
if Kbd.IsKeyPress(Kbd.Q) then -- если нажата клавиша Q
log("Нажата Q")
wait (300)
end
wait (20)
end
--lua
require("Kbd")
while 1 do
if (Kbd.IsKeyPress(Kbd.LeftShift) and Kbd.IsKeyPress(Kbd.Q)) then -- если нажат левый шифт и Q
log("+++")
wait (300)
end
wait (20)
end
--lua
require("Kbd")
log ("Для продолжения нажмите Y")
while not(Kbd.IsKeyPress(Kbd.Y)) do
wait (20)
end
log("Нажата клавиша Y")
Используются не ascii коды, а виртуальные.
https://msdn.microsoft.com/ru-ru/library/windows/desktop/dd375731(v=vs.85).aspx
Т.е. также можно проверить состояние кнопок мыши.
Хотелось бы обернуть все кнопки в парочку функций, но парсить из пилота что-то лень. Либо предлагайте идеи что подкоректить, либо просто юзайте GetKeyStateByCode на все случаи жизни.
Эта программка коды всех клавиш показывает, установки не требует
коды на популярные клавиши:
Луа порт. Только функция IsKeyPress() возвращающая флажок. Теперь не требуется указывать код сканируемой клавиши (по примеру понятно как теперь работает ?). Список клавиш будет позже (но не точно, да).
Пример
require("Kbd")
if (Kbd.IsKeyPress(Kbd.LeftShift) and Kbd.IsKeyPress(Kbd.Q)) then
log("It's work")
end
lua_pushinteger(L, VK_LBUTTON);
lua_setfield(L, -STACK_TOP + 1, "LMB");
lua_pushinteger(L, VK_RBUTTON);
lua_setfield(L, -STACK_TOP + 1, "RMB");
lua_pushinteger(L, VK_CANCEL);
lua_setfield(L, -STACK_TOP + 1, "Cancel");
lua_pushinteger(L, VK_MBUTTON);
lua_setfield(L, -STACK_TOP + 1, "MMB");
lua_pushinteger(L, VK_XBUTTON1);
lua_setfield(L, -STACK_TOP + 1, "X1MB");
lua_pushinteger(L, VK_XBUTTON2);
lua_setfield(L, -STACK_TOP + 1, "X2MB");
lua_pushinteger(L, VK_BACK);
lua_setfield(L, -STACK_TOP + 1, "Back");
lua_pushinteger(L, VK_TAB);
lua_setfield(L, -STACK_TOP + 1, "Tab");
lua_pushinteger(L, VK_CLEAR);
lua_setfield(L, -STACK_TOP + 1, "Clear");
lua_pushinteger(L, VK_RETURN);
lua_setfield(L, -STACK_TOP + 1, "Enter");
lua_pushinteger(L, VK_SHIFT);
lua_setfield(L, -STACK_TOP + 1, "Shift");
lua_pushinteger(L, VK_CONTROL);
lua_setfield(L, -STACK_TOP + 1, "Ctrl");
lua_pushinteger(L, VK_MENU);
lua_setfield(L, -STACK_TOP + 1, "Alt");
lua_pushinteger(L, VK_PAUSE);
lua_setfield(L, -STACK_TOP + 1, "Pause");
lua_pushinteger(L, VK_CAPITAL);
lua_setfield(L, -STACK_TOP + 1, "CapsLock");
lua_pushinteger(L, VK_ESCAPE);
lua_setfield(L, -STACK_TOP + 1, "Esc");
lua_pushinteger(L, VK_SPACE);
lua_setfield(L, -STACK_TOP + 1, "Space");
lua_pushinteger(L, VK_PRIOR);
lua_setfield(L, -STACK_TOP + 1, "PageUp");
lua_pushinteger(L, VK_NEXT);
lua_setfield(L, -STACK_TOP + 1, "PageDown");
lua_pushinteger(L, VK_END);
lua_setfield(L, -STACK_TOP + 1, "End");
lua_pushinteger(L, VK_HOME);
lua_setfield(L, -STACK_TOP + 1, "Home");
lua_pushinteger(L, VK_LEFT);
lua_setfield(L, -STACK_TOP + 1, "Left");
lua_pushinteger(L, VK_UP);
lua_setfield(L, -STACK_TOP + 1, "Up");
lua_pushinteger(L, VK_RIGHT);
lua_setfield(L, -STACK_TOP + 1, "Right");
lua_pushinteger(L, VK_DOWN);
lua_setfield(L, -STACK_TOP + 1, "Down");
lua_pushinteger(L, VK_SELECT);
lua_setfield(L, -STACK_TOP + 1, "Select");
lua_pushinteger(L, VK_PRINT);
lua_setfield(L, -STACK_TOP + 1, "Print");
lua_pushinteger(L, VK_EXECUTE);
lua_setfield(L, -STACK_TOP + 1, "Execute");
lua_pushinteger(L, VK_SNAPSHOT);
lua_setfield(L, -STACK_TOP + 1, "PrntScrn");
lua_pushinteger(L, VK_INSERT);
lua_setfield(L, -STACK_TOP + 1, "Insert");
lua_pushinteger(L, VK_DELETE);
lua_setfield(L, -STACK_TOP + 1, "Delete");
lua_pushinteger(L, VK_HELP);
lua_setfield(L, -STACK_TOP + 1, "Help");
lua_pushinteger(L, 0x30);
lua_setfield(L, -STACK_TOP + 1, "Key0");
lua_pushinteger(L, 0x31);
lua_setfield(L, -STACK_TOP + 1, "Key1");
lua_pushinteger(L, 0x32);
lua_setfield(L, -STACK_TOP + 1, "Key2");
lua_pushinteger(L, 0x33);
lua_setfield(L, -STACK_TOP + 1, "Key3");
lua_pushinteger(L, 0x34);
lua_setfield(L, -STACK_TOP + 1, "Key4");
lua_pushinteger(L, 0x35);
lua_setfield(L, -STACK_TOP + 1, "Key5");
lua_pushinteger(L, 0x36);
lua_setfield(L, -STACK_TOP + 1, "Key6");
lua_pushinteger(L, 0x37);
lua_setfield(L, -STACK_TOP + 1, "Key7");
lua_pushinteger(L, 0x38);
lua_setfield(L, -STACK_TOP + 1, "Key8");
lua_pushinteger(L, 0x39);
lua_setfield(L, -STACK_TOP + 1, "Key9");
lua_pushinteger(L, 0x41);
lua_setfield(L, -STACK_TOP + 1, "A");
lua_pushinteger(L, 0x42);
lua_setfield(L, -STACK_TOP + 1, "B");
lua_pushinteger(L, 0x43);
lua_setfield(L, -STACK_TOP + 1, "C");
lua_pushinteger(L, 0x44);
lua_setfield(L, -STACK_TOP + 1, "D");
lua_pushinteger(L, 0x45);
lua_setfield(L, -STACK_TOP + 1, "E");
lua_pushinteger(L, 0x46);
lua_setfield(L, -STACK_TOP + 1, "F");
lua_pushinteger(L, 0x47);
lua_setfield(L, -STACK_TOP + 1, "G");
lua_pushinteger(L, 0x48);
lua_setfield(L, -STACK_TOP + 1, "H");
lua_pushinteger(L, 0x49);
lua_setfield(L, -STACK_TOP + 1, "I");
lua_pushinteger(L, 0x4A);
lua_setfield(L, -STACK_TOP + 1, "J");
lua_pushinteger(L, 0x4B);
lua_setfield(L, -STACK_TOP + 1, "K");
lua_pushinteger(L, 0x4C);
lua_setfield(L, -STACK_TOP + 1, "L");
lua_pushinteger(L, 0x4D);
lua_setfield(L, -STACK_TOP + 1, "M");
lua_pushinteger(L, 0x4E);
lua_setfield(L, -STACK_TOP + 1, "N");
lua_pushinteger(L, 0x4F);
lua_setfield(L, -STACK_TOP + 1, "O");
lua_pushinteger(L, 0x50);
lua_setfield(L, -STACK_TOP + 1, "P");
lua_pushinteger(L, 0x51);
lua_setfield(L, -STACK_TOP + 1, "Q");
lua_pushinteger(L, 0x52);
lua_setfield(L, -STACK_TOP + 1, "R");
lua_pushinteger(L, 0x53);
lua_setfield(L, -STACK_TOP + 1, "S");
lua_pushinteger(L, 0x54);
lua_setfield(L, -STACK_TOP + 1, "T");
lua_pushinteger(L, 0x55);
lua_setfield(L, -STACK_TOP + 1, "U");
lua_pushinteger(L, 0x56);
lua_setfield(L, -STACK_TOP + 1, "V");
lua_pushinteger(L, 0x57);
lua_setfield(L, -STACK_TOP + 1, "W");
lua_pushinteger(L, 0x58);
lua_setfield(L, -STACK_TOP + 1, "X");
lua_pushinteger(L, 0x59);
lua_setfield(L, -STACK_TOP + 1, "Y");
lua_pushinteger(L, 0x5A);
lua_setfield(L, -STACK_TOP + 1, "Z");
lua_pushinteger(L, VK_LWIN);
lua_setfield(L, -STACK_TOP + 1, "LeftWin");
lua_pushinteger(L, VK_RWIN);
lua_setfield(L, -STACK_TOP + 1, "RightWin");
lua_pushinteger(L, VK_APPS);
lua_setfield(L, -STACK_TOP + 1, "AppKey");
lua_pushinteger(L, VK_SLEEP);
lua_setfield(L, -STACK_TOP + 1, "Sleep");
lua_pushinteger(L, VK_LWIN);
lua_setfield(L, -STACK_TOP + 1, "LeftWin");
lua_pushinteger(L, VK_NUMPAD0);
lua_setfield(L, -STACK_TOP + 1, "Num0");
lua_pushinteger(L, VK_NUMPAD1);
lua_setfield(L, -STACK_TOP + 1, "Num1");
lua_pushinteger(L, VK_NUMPAD2);
lua_setfield(L, -STACK_TOP + 1, "Num2");
lua_pushinteger(L, VK_NUMPAD3);
lua_setfield(L, -STACK_TOP + 1, "Num3");
lua_pushinteger(L, VK_NUMPAD4);
lua_setfield(L, -STACK_TOP + 1, "Num4");
lua_pushinteger(L, VK_NUMPAD5);
lua_setfield(L, -STACK_TOP + 1, "Num5");
lua_pushinteger(L, VK_NUMPAD6);
lua_setfield(L, -STACK_TOP + 1, "Num6");
lua_pushinteger(L, VK_NUMPAD7);
lua_setfield(L, -STACK_TOP + 1, "Num7");
lua_pushinteger(L, VK_NUMPAD8);
lua_setfield(L, -STACK_TOP + 1, "Num8");
lua_pushinteger(L, VK_NUMPAD9);
lua_setfield(L, -STACK_TOP + 1, "Num9");
lua_pushinteger(L, VK_MULTIPLY);
lua_setfield(L, -STACK_TOP + 1, "Multiply");
lua_pushinteger(L, VK_ADD);
lua_setfield(L, -STACK_TOP + 1, "Add");
lua_pushinteger(L, VK_SEPARATOR);
lua_setfield(L, -STACK_TOP + 1, "Separator");
lua_pushinteger(L, VK_SUBTRACT);
lua_setfield(L, -STACK_TOP + 1, "Subtract");
lua_pushinteger(L, VK_DECIMAL);
lua_setfield(L, -STACK_TOP + 1, "Decimal");
lua_pushinteger(L, VK_DIVIDE);
lua_setfield(L, -STACK_TOP + 1, "Divide");
lua_pushinteger(L, VK_F1);
lua_setfield(L, -STACK_TOP + 1, "F1");
lua_pushinteger(L, VK_F2);
lua_setfield(L, -STACK_TOP + 1, "F2");
lua_pushinteger(L, VK_F3);
lua_setfield(L, -STACK_TOP + 1, "F3");
lua_pushinteger(L, VK_F4);
lua_setfield(L, -STACK_TOP + 1, "F4");
lua_pushinteger(L, VK_F5);
lua_setfield(L, -STACK_TOP + 1, "F5");
lua_pushinteger(L, VK_F6);
lua_setfield(L, -STACK_TOP + 1, "F6");
lua_pushinteger(L, VK_F7);
lua_setfield(L, -STACK_TOP + 1, "F7");
lua_pushinteger(L, VK_F8);
lua_setfield(L, -STACK_TOP + 1, "F8");
lua_pushinteger(L, VK_F9);
lua_setfield(L, -STACK_TOP + 1, "F9");
lua_pushinteger(L, VK_F10);
lua_setfield(L, -STACK_TOP + 1, "F10");
lua_pushinteger(L, VK_F11);
lua_setfield(L, -STACK_TOP + 1, "F11");
lua_pushinteger(L, VK_F12);
lua_setfield(L, -STACK_TOP + 1, "F12");
lua_pushinteger(L, VK_F13);
lua_setfield(L, -STACK_TOP + 1, "F13");
lua_pushinteger(L, VK_F14);
lua_setfield(L, -STACK_TOP + 1, "F14");
lua_pushinteger(L, VK_F15);
lua_setfield(L, -STACK_TOP + 1, "F15");
lua_pushinteger(L, VK_F16);
lua_setfield(L, -STACK_TOP + 1, "F16");
lua_pushinteger(L, VK_F17);
lua_setfield(L, -STACK_TOP + 1, "F17");
lua_pushinteger(L, VK_F18);
lua_setfield(L, -STACK_TOP + 1, "F18");
lua_pushinteger(L, VK_F19);
lua_setfield(L, -STACK_TOP + 1, "F19");
lua_pushinteger(L, VK_F20);
lua_setfield(L, -STACK_TOP + 1, "F20");
lua_pushinteger(L, VK_F21);
lua_setfield(L, -STACK_TOP + 1, "F21");
lua_pushinteger(L, VK_F22);
lua_setfield(L, -STACK_TOP + 1, "F22");
lua_pushinteger(L, VK_F23);
lua_setfield(L, -STACK_TOP + 1, "F23");
lua_pushinteger(L, VK_F24);
lua_setfield(L, -STACK_TOP + 1, "F24");
lua_pushinteger(L, VK_NUMLOCK);
lua_setfield(L, -STACK_TOP + 1, "NumLock");
lua_pushinteger(L, VK_SCROLL);
lua_setfield(L, -STACK_TOP + 1, "ScrollLock");
lua_pushinteger(L, VK_LSHIFT);
lua_setfield(L, -STACK_TOP + 1, "LeftShift");
lua_pushinteger(L, VK_RSHIFT);
lua_setfield(L, -STACK_TOP + 1, "RightShift");
lua_pushinteger(L, VK_LCONTROL);
lua_setfield(L, -STACK_TOP + 1, "LeftCtrl");
lua_pushinteger(L, VK_RCONTROL);
lua_setfield(L, -STACK_TOP + 1, "RightCtrl");
lua_pushinteger(L, VK_LMENU);
lua_setfield(L, -STACK_TOP + 1, "LeftAlt");
lua_pushinteger(L, VK_RMENU);
lua_setfield(L, -STACK_TOP + 1, "RightAlt");
lua_pushinteger(L, VK_BROWSER_BACK);
lua_setfield(L, -STACK_TOP + 1, "BrowserBack");
lua_pushinteger(L, VK_BROWSER_FORWARD);
lua_setfield(L, -STACK_TOP + 1, "BrowserForward");
lua_pushinteger(L, VK_BROWSER_REFRESH);
lua_setfield(L, -STACK_TOP + 1, "BrowserRefresh");
lua_pushinteger(L, VK_BROWSER_STOP);
lua_setfield(L, -STACK_TOP + 1, "BrowserStop");
lua_pushinteger(L, VK_BROWSER_SEARCH);
lua_setfield(L, -STACK_TOP + 1, "BrowserSearch");
lua_pushinteger(L, VK_BROWSER_FAVORITES);
lua_setfield(L, -STACK_TOP + 1, "BrowserFavorites");
lua_pushinteger(L, VK_BROWSER_HOME);
lua_setfield(L, -STACK_TOP + 1, "BrowserHome");
lua_pushinteger(L, VK_VOLUME_MUTE);
lua_setfield(L, -STACK_TOP + 1, "VolMute");
lua_pushinteger(L, VK_VOLUME_DOWN);
lua_setfield(L, -STACK_TOP + 1, "VolDown");
lua_pushinteger(L, VK_VOLUME_UP);
lua_setfield(L, -STACK_TOP + 1, "VolUp");
lua_pushinteger(L, VK_VOLUME_UP);
lua_setfield(L, -STACK_TOP + 1, "VolUp");
--lua
require("Kbd")
while 1 do
if Kbd.IsKeyPress(Kbd.LeftShift) and Kbd.IsKeyPress(Kbd.Q) then
log("+++")
end
wait (20)
end
Посмотрю
Пофикшено. В том же посте.
Первый пост отредактировал.
Есть условие на "если кнопка зажата" ?
На луа работает, но что то нехочется пилотный скрипт на луа переписывать)
Какая на луа замена переходу этому?
:aaa
скрипт
if нажата F1
goto bbb
end_if
goto aaa
:bbb
скрипт
while KB.GetKeyStateByCode(112) = 0 // пока не нажата f1
wait 20
end_while
log Скрипт
end_script
--lua
require("Kbd")
while not(Kbd.IsKeyPress(Kbd.F1)) do -- пока не нажата f1
wait (20)
end
log("Скрипт")
if KB.GetKeyState(q) = 1 or KB.GetKeyState(2) = 1 or KB.GetKeyState(3) = 1 or KB.GetKeyStateByCode(1) = 1
wait 100
end_if
end_script
if KB.GetKeyState(q) = 1 or KB.GetKeyState(2) = 1 or KB.GetKeyState(3) = 1
wait 100
end_if
if KB.GetKeyStateByCode(1) = 1
wait 100
end_if
end_script
Несколько клавиш можно проверять в цикле.
init_arr %button q 1 2 3 //какие проверять клавиши
while 1 = 1
for #i 1 size(%button)
if KB.GetKeyState(%button[#i]) = 1
log %button[#i]
wait 100
end_if
wait 10
end_for
wait 10
end_while
:aaa
if KB.GetKeyState(q) = 1 // если нажата Q
log Нажата q
wait 25 + random (26)
end_if
if KB.GetKeyState(2) = 1 // если нажата 2
log Нажата 2
wait 27 + random (25)
end_if
if KB.GetKeyState(3) = 1 // если нажата 3
log Нажата 3
wait 21 + random (23)
end_if
while KB.GetKeyStateByCode(1) = 1 // если нажата ЛКМ
log Нажата ЛКМ
wait 29 + random (32)
end_while
goto aaa
--lua
require("Kbd")
while 1 do -- бесконечный цикл
while Kbd.IsKeyPress(Kbd.Q) do -- если нажата клавиша Q
log ("Нажата q")
wait (25 + math.random (23))
end
while Kbd.IsKeyPress(Kbd.key2) do -- если нажата клавиша 2
log ("Нажата 2")
wait (25 + math.random (23))
end
while Kbd.IsKeyPress(Kbd.key3) do -- если нажата клавиша 3
log ("Нажата 3")
wait (35 + math.random (27))
end
while Kbd.IsKeyPress(Kbd.LMB) do -- если нажата клавиша ЛКМ
log ("Нажата ЛКМ")
wait (25 + math.random (23))
end
end
как сделать нажатие кнопок Х Ъ, или скобки по английски.
--lua
require("Kbd")
while 1 do
if Kbd.IsKeyPress(219) then -- левая фигурная/квадратная скобка
log("++")
wait (300)
end
if Kbd.IsKeyPress(221) then -- правая фигурная/квадратная скобка
log("++++")
wait (300)
end
wait (20)
end
--lua
require("Kbd")
while 1 do
if Kbd.IsKeyPress(219) then -- левая фигурная/квадратная скобка
log("++")
wait (300)
end
if Kbd.IsKeyPress(221) then -- правая фигурная/квадратная скобка
log("++++")
wait (300)
end
wait (20)
end
Какое это имеет отношение к теме 'Определение статуса клавиш клавиатуры'. Не засоряйте темы.
set $a "["
say $a
sendex $a // только в активном окне
end_script
Написал скрипт для проверки, и не могу понять как это работает:
while KB.GetKeyStateByCode(2) = 0
end_while
hint отпустил кнопку
и запускаете его кликом кнопки мыши?)
Вроде как отслеживалось только нажатие. Зажатие проверялось только в луа.
Кстати, в 2.40 работает на луа, в 2.41 нет. В чём разница?
Вот чо-то у меня поселилась мысля если бы к командам эмуляции нажатий клавиши(send, sendex и пр.) добавить код клавиши клика левой мышки то у нас бы получилась кликаюшчыя управляемая мышка.
send 0x01 //сделать ЛКМ в текущем ее положении
Я как понял не решить задачу скрипта с зажатой кнопкой?
....
хочу чтоб перед кликом мышкой 100% был зажат CTRL, а то не всегда это случается, пишу
while_not KB.GetKeyStateByCode(162) = 1
sendex ^
end_while
while KB.GetKeyStateByCode(162) = 1
sendex
hint (20 clRed 800 900 -1 -1 (отпустил CTRL))
end_while
while_not KB.GetKeyStateByCode(162) = 1
sendex ^
end_while
Отредактировал первый пост. Добавил архив с нужными файлами и примеры использования.
Не дружит с кликами однако, либо где то туплю. В логе пишет, а sendex не проходит.
--Lua
do
local back = package.path
package.path = "luaPlugins\\winapi\\?.lua;"..package.path
setfenv(1, require'winapi')
require[[winapi.keyboard]]
package.path = back
end
while 1 do
local b_atk = GetKeyState(1)
if b_atk then
log("atk")
sendex("1")
end
end
--lua
local ffi = require("ffi")
ffi.cdef[[short GetAsyncKeyState(int vKey);]]
log 'clear' log 'mode compact'
ffi.C.GetAsyncKeyState(1)
while true do
if ffi.C.GetAsyncKeyState(1) ~= 0 then -- если нажата левая кнопка мыши
while ffi.C.GetAsyncKeyState(1) ~= 0 do wait(10) end -- ждать пока она нажата
log ("Нажата левая кнопка мыши")
sendex("1")
end
wait (100)
end
log ("Ждём когда будет нажата клавиша Y")
local state, toggle = GetKeyState(0x59)
while not state do
state, toggle = GetKeyState(0x59)
wait (10)
end
log ("Ждём когда будет нажата клавиша Y")
repeat wait(10) until GetKeyState(0x59)
Русская версия Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)