diff --git a/WebUI/script_js.h b/WebUI/script_js.h index ea3e8d3..b3d1076 100644 --- a/WebUI/script_js.h +++ b/WebUI/script_js.h @@ -456,10 +456,12 @@ const AbsMousePad = (div) => div.onmouseup = (e) => { setBtn( 0x00 ); return MouseReporter(e); } div.onmousedown = (e) => { switch (e.button) { case 0:setBtn(0x01);break; case 1:setBtn(0x04);break; case 2:setBtn(0x02);break; } return MouseReporter(e); } div.onmousemove = (e) => { setXY( e.offsetX, e.offsetY ); return MouseReporter(e); } - div.ontouchmove = (e) => { setXY( e.offsetX, e.offsetY ); return MouseReporter(e); } // mobile support ? div.onwheel = (e) => { setWheel( e ); return MouseReporter(e); } - + div.ontouchmove = (e) => { setXY( e.changedTouches[0].offsetX, e.changedTouches[0].offsetY ); return MouseReporter(e); } // mobile support ? + // div.ontouchstart = (e) => { setXY( e.offsetX, e.offsetY ); return MouseReporter(e); } // mobile support ? + //div.ontouchend = (e) => { setXY( e.offsetX, e.offsetY ); return MouseReporter(e); } // mobile support ? + //e.changedTouches[0] div.onclick = (e) => { if( e.offsetY < 0 ) div.parentElement.style.display = 'none'; return false; } diff --git a/WiFiDuck/duckparser.cpp b/WiFiDuck/duckparser.cpp index 26f171f..9d78c5a 100644 --- a/WiFiDuck/duckparser.cpp +++ b/WiFiDuck/duckparser.cpp @@ -264,7 +264,7 @@ namespace duckparser void DrawSpaceInvaders() // easter egg omg! { - xTaskCreate( [](void*param) { MouseGFX->drawXbm( &Alien_128x64, 900, 500 ); vTaskDelete(NULL); }, "blah", 2048, NULL, 16, NULL ); + MouseGFX->drawXbm( &Alien_128x64, 900, 500 ); } @@ -326,45 +326,45 @@ namespace duckcommands duckCommand KeyCommands[] = { // named keys - {"ENTER", [](){ keyboard::pressKey(KEY_ENTER); } }, - {"MENU", [](){ keyboard::pressKey(KEY_PROPS); } }, - {"APP", [](){ keyboard::pressKey(KEY_PROPS); } }, - {"DELETE", [](){ keyboard::pressKey(KEY_Delete); } }, - {"BACKSPACE", [](){ keyboard::pressKey(KEY_BCKSPACE); } }, - {"HOME", [](){ keyboard::pressKey(KEY_Home); } }, - {"INSERT", [](){ keyboard::pressKey(KEY_INSRT); } }, - {"PAGEUP", [](){ keyboard::pressKey(KEY_PAGEUP); } }, - {"PAGEDOWN", [](){ keyboard::pressKey(KEY_PAGEDOWN); } }, - {"UPARROW", [](){ keyboard::pressKey(KEY_UP); } }, - {"UP", [](){ keyboard::pressKey(KEY_UP); } }, - {"DOWNARROW", [](){ keyboard::pressKey(KEY_DOWN); } }, - {"DOWN", [](){ keyboard::pressKey(KEY_DOWN); } }, - {"LEFTARROW", [](){ keyboard::pressKey(KEY_LEFT); } }, - {"LEFT", [](){ keyboard::pressKey(KEY_LEFT); } }, - {"RIGHTARROW", [](){ keyboard::pressKey(KEY_RIGHT); } }, - {"RIGHT", [](){ keyboard::pressKey(KEY_RIGHT); } }, + {"ENTER", [](){ keyboard::pressKey(KEY_ENTER); } }, + {"MENU", [](){ keyboard::pressKey(KEY_PROPS); } }, + {"APP", [](){ keyboard::pressKey(KEY_PROPS); } }, + {"DELETE", [](){ keyboard::pressKey(KEY_Delete); } }, + {"BACKSPACE", [](){ keyboard::pressKey(KEY_BCKSPACE); } }, + {"HOME", [](){ keyboard::pressKey(KEY_Home); } }, + {"INSERT", [](){ keyboard::pressKey(KEY_INSRT); } }, + {"PAGEUP", [](){ keyboard::pressKey(KEY_PAGEUP); } }, + {"PAGEDOWN", [](){ keyboard::pressKey(KEY_PAGEDOWN); } }, + {"UPARROW", [](){ keyboard::pressKey(KEY_UP); } }, + {"UP", [](){ keyboard::pressKey(KEY_UP); } }, + {"DOWNARROW", [](){ keyboard::pressKey(KEY_DOWN); } }, + {"DOWN", [](){ keyboard::pressKey(KEY_DOWN); } }, + {"LEFTARROW", [](){ keyboard::pressKey(KEY_LEFT); } }, + {"LEFT", [](){ keyboard::pressKey(KEY_LEFT); } }, + {"RIGHTARROW", [](){ keyboard::pressKey(KEY_RIGHT); } }, + {"RIGHT", [](){ keyboard::pressKey(KEY_RIGHT); } }, {"TAB", [](){ keyboard::pressKey(KEY_TABULATION); } }, - {"END", [](){ keyboard::pressKey(KEY_End); } }, - {"ESC", [](){ keyboard::pressKey(KEY_ESCAPE); } }, - {"ESCAPE", [](){ keyboard::pressKey(KEY_ESCAPE); } }, - {"F1", [](){ keyboard::pressKey(KEY_F_1); } }, - {"F2", [](){ keyboard::pressKey(KEY_F_2); } }, - {"F3", [](){ keyboard::pressKey(KEY_F_3); } }, - {"F4", [](){ keyboard::pressKey(KEY_F_4); } }, - {"F5", [](){ keyboard::pressKey(KEY_F_5); } }, - {"F6", [](){ keyboard::pressKey(KEY_F_6); } }, - {"F7", [](){ keyboard::pressKey(KEY_F_7); } }, - {"F8", [](){ keyboard::pressKey(KEY_F_8); } }, - {"F9", [](){ keyboard::pressKey(KEY_F_9); } }, - {"F10", [](){ keyboard::pressKey(KEY_F_10); } }, - {"F11", [](){ keyboard::pressKey(KEY_F_11); } }, - {"F12", [](){ keyboard::pressKey(KEY_F_12); } }, - {"SPACE", [](){ keyboard::pressKey(KEY_SPACE); } }, - {"PAUSE", [](){ keyboard::pressKey(KEY_PAUSE); } }, - {"BREAK", [](){ keyboard::pressKey(KEY_PAUSE); } }, - {"CAPSLOCK", [](){ keyboard::pressKey(KEY_CAPSLOCK); } }, - {"NUMLOCK", [](){ keyboard::pressKey(KEY_NUMLOCK); } }, - {"PRINTSCREEN", [](){ keyboard::pressKey(KEY_SYSRQ); } }, + {"END", [](){ keyboard::pressKey(KEY_End); } }, + {"ESC", [](){ keyboard::pressKey(KEY_ESCAPE); } }, + {"ESCAPE", [](){ keyboard::pressKey(KEY_ESCAPE); } }, + {"F1", [](){ keyboard::pressKey(KEY_F_1); } }, + {"F2", [](){ keyboard::pressKey(KEY_F_2); } }, + {"F3", [](){ keyboard::pressKey(KEY_F_3); } }, + {"F4", [](){ keyboard::pressKey(KEY_F_4); } }, + {"F5", [](){ keyboard::pressKey(KEY_F_5); } }, + {"F6", [](){ keyboard::pressKey(KEY_F_6); } }, + {"F7", [](){ keyboard::pressKey(KEY_F_7); } }, + {"F8", [](){ keyboard::pressKey(KEY_F_8); } }, + {"F9", [](){ keyboard::pressKey(KEY_F_9); } }, + {"F10", [](){ keyboard::pressKey(KEY_F_10); } }, + {"F11", [](){ keyboard::pressKey(KEY_F_11); } }, + {"F12", [](){ keyboard::pressKey(KEY_F_12); } }, + {"SPACE", [](){ keyboard::pressKey(KEY_SPACE); } }, + {"PAUSE", [](){ keyboard::pressKey(KEY_PAUSE); } }, + {"BREAK", [](){ keyboard::pressKey(KEY_PAUSE); } }, + {"CAPSLOCK", [](){ keyboard::pressKey(KEY_CAPSLOCK); } }, + {"NUMLOCK", [](){ keyboard::pressKey(KEY_NUMLOCK); } }, + {"PRINTSCREEN", [](){ keyboard::pressKey(KEY_SYSRQ); } }, {"SCROLLLOCK", [](){ keyboard::pressKey(KEY_SCROLLLOCK); } }, // numpad keys @@ -385,12 +385,12 @@ namespace duckcommands {"NUM_PLUS", [](){ keyboard::pressKey(KEY_KPPLUS); } }, // modifiers - {"CTRL", [](){ keyboard::pressModifier(KEY_MOD_LCTRL); } }, - {"CONTROL", [](){ keyboard::pressModifier(KEY_MOD_LCTRL); } }, + {"CTRL", [](){ keyboard::pressModifier(KEY_MOD_LCTRL); } }, + {"CONTROL", [](){ keyboard::pressModifier(KEY_MOD_LCTRL); } }, {"SHIFT", [](){ keyboard::pressModifier(KEY_MOD_LSHIFT); } }, - {"ALT", [](){ keyboard::pressModifier(KEY_MOD_LALT); } }, - {"WINDOWS", [](){ keyboard::pressModifier(KEY_MOD_LMETA); } }, - {"GUI", [](){ keyboard::pressModifier(KEY_MOD_LMETA); } }, + {"ALT", [](){ keyboard::pressModifier(KEY_MOD_LALT); } }, + {"WINDOWS", [](){ keyboard::pressModifier(KEY_MOD_LMETA); } }, + {"GUI", [](){ keyboard::pressModifier(KEY_MOD_LMETA); } }, }; };