diff --git a/apps/presentor/ChangeLog b/apps/presentor/ChangeLog index 26f9ed6d7..a42c6594d 100644 --- a/apps/presentor/ChangeLog +++ b/apps/presentor/ChangeLog @@ -10,4 +10,5 @@ 0.10: Bugfixes. 0.11: Fix mouse move getting stuck. 0.12: Added support for mouse dragging action (click then drag). -0.13: Removed mouse dragging (too buggy/unuseful). \ No newline at end of file +0.13: Removed mouse dragging (too buggy/unuseful). +0.14: Bugfix and add pointer mode. Also added default screen when no parts are there. \ No newline at end of file diff --git a/apps/presentor/README.md b/apps/presentor/README.md index 9f2a411e1..37d3e0009 100644 --- a/apps/presentor/README.md +++ b/apps/presentor/README.md @@ -56,16 +56,24 @@ If "Try connecting your device again." is shown, switch PC/laptop bluetooth off 16. Mouse mode - Swipe to move pointer over the presentation screen + - Tap to left click. + - Hold longer to right click. 17. Holding mode In timer/presentation mode, hold one finger on your Bangle screen, point your arm foreward - Mouse up/down on screen: Tilt your hand up/down - Mouse left/right on screen: Rotate your hand counterclockwise/clockwise -18. End of presentation? +18. Spotlight mode + - Dubble press button to go into presentor mode. + - Allows to move mouse but no clicking. + - Presses SHIFT+F10 on start (you can use app such as powertoys to set spotlight to this combo) + - Presses F10 at the end (will dis-engage spotlight for instance in powertoys) + +19. End of presentation? Switch bluetooth PC/laptop off or see step 1 -19. Re-activate smartphone bluetooth (incl. Gadgetbridge) +20. Re-activate smartphone bluetooth (incl. Gadgetbridge) ### Creator [7kasper](https://github.com/7kasper) diff --git a/apps/presentor/app.js b/apps/presentor/app.js index 27403c919..a501b3376 100644 --- a/apps/presentor/app.js +++ b/apps/presentor/app.js @@ -1,5 +1,5 @@ // Presentor by 7kasper (Kasper Müller) -// Version 4.0 +// Version 0.14 // Imports const bt = require("ble_hid_combo"); @@ -85,6 +85,7 @@ let lasty = 0; // Mouse states let holding = false; let trackPadMode = false; +let focusMode = false; // Timeout IDs. let timeoutId = -1; @@ -97,6 +98,7 @@ let homePitch = 0; let mCal = 0; let mttl = 0; let cttl = 0; +let bttl = 0; // BT helper. let clearToSend = true; @@ -198,6 +200,11 @@ function drawMain() { function doPPart(r) { pparti += r; + if (settings.pparts.length == 0) { + mainLayout.Subject.label = 'PRESENTOR'; + mainLayout.Notes.label = ''; + return; + } if (pparti < 0) { pparti = -1; mainLayout.Subject.label = 'PAUSED'; @@ -264,21 +271,22 @@ Bangle.on('lock', function(on) { }); function startHolding() { - bt.tapKey(0xE0, () => bt.tapKey(0xE0)); + bt.tapKey(bt.KEY.F10, bt.MODIFY.SHIFT); holding = true; + focusMode = true; Bangle.buzz(); E.showMessage('Holding'); Bangle.on('accel', handleAcc); Bangle.setLCDPower(1); } function stopHolding() { - clearTimeout(timeoutHolding); if (holding) { - bt.tapKey(0xE0); + bt.tapKey(bt.KEY.F10); // bt.tapKey(bt.KEY.F10); homePitch = 0; homeRoll = 0; holding = false; + focusMode = false; mCal = 0; Bangle.removeListener('accel', handleAcc); Bangle.buzz(); @@ -318,17 +326,17 @@ Bangle.on('drag', function(e) { timeoutSendMouse = setTimeout(function() {clearToSend = true; timeoutSendMouse = -1;}, 50); } if (!e.b) { - // short press - if (getTime() - cttl < 0.2) { - bt.holdButton(bt.BUTTON.LEFT); - console.log("click left"); - clearToSend = true; - } - // longer press in center - else if (getTime() - cttl < 0.6 && e.x > g.getWidth()/4 && e.x < 3 * g.getWidth()/4 && e.y > g.getHeight() / 4 && e.y < 3 * g.getHeight() / 4) { - bt.holdButton(bt.BUTTON.RIGHT); - console.log("click right"); - clearToSend = true; + if (!focusMode) { + // short press + if (getTime() - cttl < 0.2) { + bt.clickButton(bt.BUTTON.LEFT); + console.log("click left"); + } + // longer press in center + else if (getTime() - cttl < 0.6 && e.x > g.getWidth()/4 && e.x < 3 * g.getWidth()/4 && e.y > g.getHeight() / 4 && e.y < 3 * g.getHeight() / 4) { + bt.clickButton(bt.BUTTON.RIGHT); + console.log("click right"); + } } cttl = 0; lastx = 0; @@ -372,9 +380,19 @@ Bangle.on('drag', function(e) { function onBtn() { if (trackPadMode) { - trackPadMode = false; - stopHolding(); - drawMain(); + if ((getTime() - bttl < 0.4 && !focusMode)) { + E.showMessage('Pointer'); + focusMode = true; + bt.tapKey(bt.KEY.F10, bt.MODIFY.SHIFT); + } else { + trackPadMode = false; + stopHolding(); + drawMain(); + if (focusMode) { + bt.tapKey(bt.KEY.F10); + focusMode = false; + } + } } else { stopHolding(); clearToSend = true; @@ -384,7 +402,8 @@ function onBtn() { if (timeoutDraw != -1) { clearTimeout(timeoutDraw); timeoutDraw = -1; - } + } + bttl = getTime(); } Bangle.buzz(); } diff --git a/apps/presentor/metadata.json b/apps/presentor/metadata.json index babb4b14a..e44684fda 100644 --- a/apps/presentor/metadata.json +++ b/apps/presentor/metadata.json @@ -1,7 +1,7 @@ { "id": "presentor", "name": "Presentor", - "version": "0.13", + "version": "0.14", "description": "Use your Bangle to present!", "icon": "app.png", "type": "app",