Read the statement by Michael Teeuw here.
Need help MMM-touch MMM-pages MMM-page indicator
-
@wishmaster270, Hello your last response was super helpful and I adopted many of the items you mentioned (e.g., z-index) - so thank you!!
I realize this is from quite a while ago, but I am hoping for a bit more advice for this if possible. I have MMM-pages, MMM-page-indicator, and MMM-Touch; with your suggestions I am able to click the page-indicator buttons and switch through the pages I have set up. However, I still cannot get the “Swipe” to work. I can see that the swipe left/right gestures are being recognized using the developer console but they aren’t triggering MMM-pages or MMM-page-indicator to move.
*I CAN see this successfully happen when pressing/tapping the indicator buttons, so I have an idea of what it should do.{ module: "MMM-Touch", position: "fullscreen_above", config: { useDisplay: false, defaultMode: "default", gestureCommands: { "MMM-page-indicator":{ "TAP_1": (commander) => {commander.sendNotification("PAGE_CHANGED")}, }, "MMM-pages":{ "MOVE_LEFT_1": (commander) => {commander.sendNotification("PAGE_DECREMENT")}, "MOVE_RIGHT_1": (commander) => {commander.sendNotification("PAGE_INCREMENT")}, }, }, } },
I noticed your code has either “true” or “null” at the end of the statement and I’ve seen other examples of this with numerical values. Any suggestions on how to best incorporate that into what I currently have set up?
Thank you!
-
@CurlyQ12391
Use “SWIPE_LEFT_1” instead of “MOVE_LEFT_1”. These 2 gestures are different. -
@CurlyQ12391
And… I’m not familiar with MMM-Pages, so cannot show the example,
But with MMM-Scenes, it would be like this;{ module: "MMM-Touch", position: "bottom_left", classes: "home page1 page2", config: { gestureCommands: { "default": { "SWIPE_RIGHT_1" : (commander) => { commander.sendNotification("SCENES_PREV", { options: { admitAnimation: "pageRight", expelAnimation: "pageRight", } }) }, "SWIPE_LEFT_1" : (commander) => { commander.sendNotification("SCENES_NEXT", { options: { admitAnimation: "pageLeft", expelAnimation: "pageLeft", } }) }, "PRESS_1" : (commander) => { commander.sendNotification("SCENES_ACT", { index: 0, options: { admitAnimation: "fadeIn", expelAnimation: "fadeOut", } }) } }, }, } }, { module: "MMM-Scenes", position: "bottom_right", classes: "home page1 page2", config: { scenario: ["home", "page1", "page2"], autoLoop: "no", } },
Here the demo link to youtube
-
@MMRIZE, thank you for catching those gesture name errors and giving my another example. I FINALLY GOT IT :)
{ module: "MMM-Touch", position: "bottom_bar", disabled: false, config: { debug: false, useDisplay: false, autoMode: false, defaultMode: "default", gestureCommands: { "default":{ "TAP_1": (commander) => {commander.sendNotification("USER_PRESENCE", true);}, "SWIPE_LEFT_1": (commander) => {commander.sendNotification("PAGE_DECREMENT", null);}, "SWIPE_RIGHT_1": (commander) => {commander.sendNotification("PAGE_INCREMENT", null);}, }, }, } },
I tried to change things systematically to determine what truly made it start working was the addition of payload after “USER_PRESENCE” and oddly enough adding semicolons at the end of each gesture command.
Hopefully this thread can help someone else down the line :)
-
@CurlyQ12391 @MMRIZE, I followed this thread to enable the swipe left and right to change pages but I’ve run into an issue that this only works when I have the dev console open, either using npm start dev or npm run start followed by ctrl+shift+i. Do you have any ideas why it would only work when the dev console is open?
-
@tburk32 no. the code doesn’t know
-
@tburk32 also, before 2.30
you could do
npm start dev
on 2.30, because of the different ui engine choices
npm run start:dev
-
@sdetweil I agree, but it isn’t the way it’s acting. When I have it in the dev console, a grey circle also appears on the screen as a cursor and I’m wondering if that is part of the difference.
-
@tburk32 maybe the dev console gives you access under the z-index for touch
-
@sdetweil I removed all of the other modules in my config.js file and experienced the same results. To go one step further with the z-index exploration, I added this to the custom.css.
.MMM-Touch (position: absolute; z-index -1)
Additionally, while having the dev console open, clicks with a mouse also register on MMM-Touch, so I it doesn’t seem like it’s unique to the display/touch function.
I really appreciate your responses so far.