Fixes and add spotlight and default screen
parent
ff4a57de76
commit
65fa387739
|
|
@ -11,3 +11,4 @@
|
||||||
0.11: Fix mouse move getting stuck.
|
0.11: Fix mouse move getting stuck.
|
||||||
0.12: Added support for mouse dragging action (click then drag).
|
0.12: Added support for mouse dragging action (click then drag).
|
||||||
0.13: Removed mouse dragging (too buggy/unuseful).
|
0.13: Removed mouse dragging (too buggy/unuseful).
|
||||||
|
0.14: Bugfix and add pointer mode. Also added default screen when no parts are there.
|
||||||
|
|
@ -56,16 +56,24 @@ If "Try connecting your device again." is shown, switch PC/laptop bluetooth off
|
||||||
|
|
||||||
16. Mouse mode
|
16. Mouse mode
|
||||||
- Swipe to move pointer over the presentation screen
|
- Swipe to move pointer over the presentation screen
|
||||||
|
- Tap to left click.
|
||||||
|
- Hold longer to right click.
|
||||||
|
|
||||||
17. Holding mode
|
17. Holding mode
|
||||||
In timer/presentation mode, hold one finger on your Bangle screen, point your arm foreward
|
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 up/down on screen: Tilt your hand up/down
|
||||||
- Mouse left/right on screen: Rotate your hand counterclockwise/clockwise
|
- 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
|
Switch bluetooth PC/laptop off or see step 1
|
||||||
|
|
||||||
19. Re-activate smartphone bluetooth (incl. Gadgetbridge)
|
20. Re-activate smartphone bluetooth (incl. Gadgetbridge)
|
||||||
|
|
||||||
### Creator
|
### Creator
|
||||||
[7kasper](https://github.com/7kasper)
|
[7kasper](https://github.com/7kasper)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// Presentor by 7kasper (Kasper Müller)
|
// Presentor by 7kasper (Kasper Müller)
|
||||||
// Version 4.0
|
// Version 0.14
|
||||||
|
|
||||||
// Imports
|
// Imports
|
||||||
const bt = require("ble_hid_combo");
|
const bt = require("ble_hid_combo");
|
||||||
|
|
@ -85,6 +85,7 @@ let lasty = 0;
|
||||||
// Mouse states
|
// Mouse states
|
||||||
let holding = false;
|
let holding = false;
|
||||||
let trackPadMode = false;
|
let trackPadMode = false;
|
||||||
|
let focusMode = false;
|
||||||
|
|
||||||
// Timeout IDs.
|
// Timeout IDs.
|
||||||
let timeoutId = -1;
|
let timeoutId = -1;
|
||||||
|
|
@ -97,6 +98,7 @@ let homePitch = 0;
|
||||||
let mCal = 0;
|
let mCal = 0;
|
||||||
let mttl = 0;
|
let mttl = 0;
|
||||||
let cttl = 0;
|
let cttl = 0;
|
||||||
|
let bttl = 0;
|
||||||
|
|
||||||
// BT helper.
|
// BT helper.
|
||||||
let clearToSend = true;
|
let clearToSend = true;
|
||||||
|
|
@ -198,6 +200,11 @@ function drawMain() {
|
||||||
|
|
||||||
function doPPart(r) {
|
function doPPart(r) {
|
||||||
pparti += r;
|
pparti += r;
|
||||||
|
if (settings.pparts.length == 0) {
|
||||||
|
mainLayout.Subject.label = 'PRESENTOR';
|
||||||
|
mainLayout.Notes.label = '';
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (pparti < 0) {
|
if (pparti < 0) {
|
||||||
pparti = -1;
|
pparti = -1;
|
||||||
mainLayout.Subject.label = 'PAUSED';
|
mainLayout.Subject.label = 'PAUSED';
|
||||||
|
|
@ -264,21 +271,22 @@ Bangle.on('lock', function(on) {
|
||||||
});
|
});
|
||||||
|
|
||||||
function startHolding() {
|
function startHolding() {
|
||||||
bt.tapKey(0xE0, () => bt.tapKey(0xE0));
|
bt.tapKey(bt.KEY.F10, bt.MODIFY.SHIFT);
|
||||||
holding = true;
|
holding = true;
|
||||||
|
focusMode = true;
|
||||||
Bangle.buzz();
|
Bangle.buzz();
|
||||||
E.showMessage('Holding');
|
E.showMessage('Holding');
|
||||||
Bangle.on('accel', handleAcc);
|
Bangle.on('accel', handleAcc);
|
||||||
Bangle.setLCDPower(1);
|
Bangle.setLCDPower(1);
|
||||||
}
|
}
|
||||||
function stopHolding() {
|
function stopHolding() {
|
||||||
clearTimeout(timeoutHolding);
|
|
||||||
if (holding) {
|
if (holding) {
|
||||||
bt.tapKey(0xE0);
|
bt.tapKey(bt.KEY.F10);
|
||||||
// bt.tapKey(bt.KEY.F10);
|
// bt.tapKey(bt.KEY.F10);
|
||||||
homePitch = 0;
|
homePitch = 0;
|
||||||
homeRoll = 0;
|
homeRoll = 0;
|
||||||
holding = false;
|
holding = false;
|
||||||
|
focusMode = false;
|
||||||
mCal = 0;
|
mCal = 0;
|
||||||
Bangle.removeListener('accel', handleAcc);
|
Bangle.removeListener('accel', handleAcc);
|
||||||
Bangle.buzz();
|
Bangle.buzz();
|
||||||
|
|
@ -318,17 +326,17 @@ Bangle.on('drag', function(e) {
|
||||||
timeoutSendMouse = setTimeout(function() {clearToSend = true; timeoutSendMouse = -1;}, 50);
|
timeoutSendMouse = setTimeout(function() {clearToSend = true; timeoutSendMouse = -1;}, 50);
|
||||||
}
|
}
|
||||||
if (!e.b) {
|
if (!e.b) {
|
||||||
// short press
|
if (!focusMode) {
|
||||||
if (getTime() - cttl < 0.2) {
|
// short press
|
||||||
bt.holdButton(bt.BUTTON.LEFT);
|
if (getTime() - cttl < 0.2) {
|
||||||
console.log("click left");
|
bt.clickButton(bt.BUTTON.LEFT);
|
||||||
clearToSend = true;
|
console.log("click left");
|
||||||
}
|
}
|
||||||
// longer press in center
|
// 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) {
|
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);
|
bt.clickButton(bt.BUTTON.RIGHT);
|
||||||
console.log("click right");
|
console.log("click right");
|
||||||
clearToSend = true;
|
}
|
||||||
}
|
}
|
||||||
cttl = 0;
|
cttl = 0;
|
||||||
lastx = 0;
|
lastx = 0;
|
||||||
|
|
@ -372,9 +380,19 @@ Bangle.on('drag', function(e) {
|
||||||
|
|
||||||
function onBtn() {
|
function onBtn() {
|
||||||
if (trackPadMode) {
|
if (trackPadMode) {
|
||||||
trackPadMode = false;
|
if ((getTime() - bttl < 0.4 && !focusMode)) {
|
||||||
stopHolding();
|
E.showMessage('Pointer');
|
||||||
drawMain();
|
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 {
|
} else {
|
||||||
stopHolding();
|
stopHolding();
|
||||||
clearToSend = true;
|
clearToSend = true;
|
||||||
|
|
@ -385,6 +403,7 @@ function onBtn() {
|
||||||
clearTimeout(timeoutDraw);
|
clearTimeout(timeoutDraw);
|
||||||
timeoutDraw = -1;
|
timeoutDraw = -1;
|
||||||
}
|
}
|
||||||
|
bttl = getTime();
|
||||||
}
|
}
|
||||||
Bangle.buzz();
|
Bangle.buzz();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "presentor",
|
"id": "presentor",
|
||||||
"name": "Presentor",
|
"name": "Presentor",
|
||||||
"version": "0.13",
|
"version": "0.14",
|
||||||
"description": "Use your Bangle to present!",
|
"description": "Use your Bangle to present!",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"type": "app",
|
"type": "app",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue