|
1 | 1 | { |
2 | | - // If doing regular loads, not Bangle.load, this is used: |
3 | | - if (global.__FILE__=="messagegui.new.js") { |
4 | | - onTwistEmitDrag(); |
5 | | - } |
6 | | - |
7 | | - let attachAfterTimeout = ()=>{ |
8 | | - setTimeout(()=>{ |
9 | | - if (global.__FILE__=="messagegui.new.js") { |
10 | | - onTwistEmitDrag(); |
11 | | - } |
12 | | - },700) |
13 | | - // It feels like there's a more elegant solution than checking the filename |
14 | | - // after 700 milliseconds. But this at least seems to work w/o sometimes |
15 | | - // activating when it shouldn't. |
16 | | - // Maybe we could add events for when fast load and/or Bangle.uiRemove occurs? |
17 | | - // Then that could be used similarly to boot code and/or the `kill` event. |
18 | | - } |
19 | | - |
20 | | - // If Fastload Utils is installed this is used: |
21 | | - Bangle.on("message", (_, msg)=>{if (Bangle.CLOCK && msg.new) { |
22 | | - attachAfterTimeout(); |
23 | | - }}); |
24 | | - |
25 | 2 | // twistThreshold How much acceleration to register a twist of the watch strap? Can be negative for opposite direction. default = 800 |
26 | 3 | // twistMaxY Maximum acceleration in Y to trigger a twist (low Y means watch is facing the right way up). default = -800 |
27 | 4 | // twistTimeout How little time (in ms) must a twist take from low->high acceleration? default = 1000 |
|
59 | 36 | }}, |
60 | 37 | 800) |
61 | 38 | } |
| 39 | + |
| 40 | + // If doing regular loads, not Bangle.load, this is used: |
| 41 | + if (global.__FILE__=="messagegui.new.js") { |
| 42 | + onTwistEmitDrag(); |
| 43 | + } |
| 44 | + |
| 45 | + let attachAfterTimeout = ()=>{ |
| 46 | + setTimeout(()=>{ |
| 47 | + if (global.__FILE__=="messagegui.new.js") { |
| 48 | + onTwistEmitDrag(); |
| 49 | + } |
| 50 | + },700) |
| 51 | + // It feels like there's a more elegant solution than checking the filename |
| 52 | + // after 700 milliseconds. But this at least seems to work w/o sometimes |
| 53 | + // activating when it shouldn't. |
| 54 | + // Maybe we could add events for when fast load and/or Bangle.uiRemove occurs? |
| 55 | + // Then that could be used similarly to boot code and/or the `kill` event. |
| 56 | + } |
| 57 | + |
| 58 | + // If Fastload Utils is installed this is used: |
| 59 | + Bangle.on("message", (_, msg)=>{if (Bangle.CLOCK && msg.new) { |
| 60 | + attachAfterTimeout(); |
| 61 | + }}); |
| 62 | + |
62 | 63 | } |
0 commit comments