Skip to content

Commit

Permalink
detach from task
Browse files Browse the repository at this point in the history
  • Loading branch information
tobozo committed Mar 27, 2022
1 parent 3549eaa commit b9914f3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 46 deletions.
6 changes: 4 additions & 2 deletions WebUI/script_js.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
88 changes: 44 additions & 44 deletions WiFiDuck/duckparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}


Expand Down Expand Up @@ -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
Expand All @@ -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); } },
};

};
Expand Down

0 comments on commit b9914f3

Please sign in to comment.