espruino / EspruinoDocs

See http://espruino.com for the complete Espruino Documentation - many links in this repository will not work
http://www.espruino.com/
Other
253 stars 282 forks source link

[Hardware Reference - SetUI] #682

Closed thyttan closed 1 year ago

thyttan commented 1 year ago

Currently:

Currently supported interface types are:

  • 'updown' - UI input with upwards motion cb(-1), downwards motion cb(1), and select cb()
    • Bangle.js 1 uses BTN1/3 for up/down and BTN2 for >select
    • Bangle.js 2 uses touchscreen swipe up/down and tap
  • 'leftright' - UI input with left motion cb(-1), right motion cb(1), and select cb()
    • Bangle.js 1 uses BTN1/3 for left/right and BTN2 for select
    • Bangle.js 2 uses touchscreen swipe left/right and tap/BTN1 for select
  • 'clock' - called for clocks. Sets Bangle.CLOCK=1 and allows a button to start the launcher
    • Bangle.js 1 BTN2 starts the launcher
    • Bangle.js 2 BTN1 starts the launcher
  • 'clockupdown' - called for clocks. Sets Bangle.CLOCK=1, allows a button to start the launcher, but also provides up/down functionality
    • Bangle.js 1 BTN2 starts the launcher, BTN1/BTN3 call cb(-1) and cb(1)
    • Bangle.js 2 BTN1 starts the launcher, touchscreen tap in top/bottom right hand side calls cb(-1) and cb(1)
  • {mode:"custom", ...} allows you to specify custom handlers for different interactions. See below.
  • undefined removes all user interaction code

I Propose adding something along the lines of:

  • 'clockupdown' ...
  • 'touch' - some description
  • {mode:"custom", ...} ....

since there are this code in Bangle_setUI_Q3.js:

  } else if (mode=="touch") {
    Bangle.touchHandler = (_,e) => {b();cb(e);};

I would do a PR but I don't know where.

I noticed this when working on https://github.com/espruino/Espruino/pull/2287.

gfwilliams commented 1 year ago

Thanks! I'm actually wondering whether since we now have custom mode which handles touch, and touch doesn't appear to be used in BangleApps, we should just remove this?

Just so you know, the docs are in the Espruino repo. If you look in the reference and click on next to the title of the function/method it'll bring you to where it's defined.

thyttan commented 1 year ago

Thanks! I'm actually wondering whether since we now have custom mode which handles touch, and touch doesn't appear to be used in BangleApps, we should just remove this?

That makes sense to me!

Just so you know, the docs are in the Espruino repo. If you look in the reference and click on next to the title of the function/method it'll bring you to where it's defined.

Thanks!

gfwilliams commented 1 year ago

Ok, should be sorted now!