Bangle 2 - Disable haptic feedback?

Posted on
  • I may be missing something obvious, but is there a way to turn off the haptic vibration that occurs when navigating through the menus?

    I've dug around the settings and cannot seem to find an option. Would be nice to have a toggle and even nicer if it were to respect the "Quiet Time" setting

  • You can just turn 'Vibrate' to 'off' in settings and that should do it?

    But there's no specific setting for disabling haptic feedback at the moment. It could be added relatively easily though since I believe it all happens in Bangle.setUI

  • Thanks @Gordon, I could disable vibrate but won't that disable it for notifications as well? I might be misunderstanding that setting. Ideally I would like haptic feedback off but notification vibration on

  • Yes, you're right there. I've made a note and will try and add it to the firmware.

    For now, you could put this code into a file nohaptic.boot.js on the Bangle using the Web IDE and that should fix it:

    Bangle.setUI = (function(mode, cb) {
      if (Bangle.btnWatches) {
        Bangle.btnWatches.forEach(clearWatch);
        delete Bangle.btnWatches;
      }
      if (Bangle.dragHandler) {
        Bangle.removeListener("drag", Bangle.dragHandler);
        delete Bangle.dragHandler;
      }
      if (Bangle.touchHandler) {
        Bangle.removeListener("touch", Bangle.touchHandler);
        delete Bangle.touchHandler;
      }
      if (!mode) return;
      else if (mode=="updown") {
        var dy = 0;    
        Bangle.dragHandler = e=>{
          dy += e.dy;
          if (!e.b) dy=0;
          while (Math.abs(dy)>32) {
            if (dy>0) { dy-=32; cb(1) }
            else { dy+=32; cb(-1) }
          }
        };
        Bangle.on('drag',Bangle.dragHandler);
        Bangle.touchHandler = d => {cb();};
        Bangle.on("touch", Bangle.touchHandler);
        Bangle.btnWatches = [
          setWatch(function() { cb(); }, BTN1, {repeat:1}),
        ];
      } else if (mode=="leftright") {
        var dx = 0;    
        Bangle.dragHandler = e=>{
          dx += e.dx;
          if (!e.b) dx=0;
          while (Math.abs(dx)>32) {
            if (dx>0) { dx-=32; cb(1) }
            else { dx+=32; cb(-1) }
          }
        };
        Bangle.on('drag',Bangle.dragHandler);
        Bangle.touchHandler = d => {cb();};
        Bangle.on("touch", Bangle.touchHandler);
        Bangle.btnWatches = [
          setWatch(function() { cb(); }, BTN1, {repeat:1}),
        ];
      } else if (mode=="clock") {
        Bangle.CLOCK=1;
        Bangle.btnWatches = [
          setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"falling"})
        ];
      } else if (mode=="clockupdown") {
        Bangle.CLOCK=1;
        Bangle.touchHandler = (d,e) => {
          if (e.x < 120) return;
          cb((e.y > 88) ? 1 : -1);
        };
        Bangle.on("touch", Bangle.touchHandler);
        Bangle.btnWatches = [
          setWatch(Bangle.showLauncher, BTN1, {repeat:1,edge:"falling"})
        ];
      } else if (mode=="touch") {
        Bangle.touchHandler = (_,e) => {cb(e);};
        Bangle.on("touch", Bangle.touchHandler);
      } else
        throw new Error("Unknown UI mode");
    })
    
  • That's awesome, thanks @Gordon! I'll give that code a try

  • Just a note that I did look at making haptic configurable but honestly I'm expecting to redo the menu system so it scrolls properly as the more I use it the more it annoys me.

    So realistically, best to use the code above, and hopefully at some point soon the menus will change such that no haptics are needed at all

  • That sounds excellent @Gordon. I was beginning to experiment with creating a menu system utilising the Launcher style of display to try and make more "user friendly" menus. Just need some time to mess around with it that I hope I will find soon. But either way I imagine whatever you implement will be far superior than what I end up making ha!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Bangle 2 - Disable haptic feedback?

Posted by Avatar for Weagertron @Weagertron

Actions