Hi AxLED,
thanks for your response.
I tried to trigger the NextSlide function (line 75) and the PrevSlide function (line 79) by adding the following code:
notificationReceived: function (notification, payload, sender) {
var position, positions = ['top_bar', 'bottom_bar', 'top_left', 'bottom_left', 'top_center', 'bottom_center', 'top_right', 'bottom_right', 'upper_third', 'middle_center', 'lower_third'];
if (notification === 'MODULE_DOM_CREATED') {
// Initially, all modules are hidden except the first and any ignored modules
// We start by getting a list of all of the modules in the transition cycle
if ((this.config.mode === 'global') || (this.config.mode === 'slides')) {
this.setUpTransitionTimers(null);
} else {
for (position = 0; position < positions.length; position += 1) {
if (this.config[positions[position]].enabled === true) {
this.setUpTransitionTimers(positions[position]);
}
}
}
},
//-----BOBBY CODE
switch (notification) {
case 'SLIDE_INCREMENT':
Log.log(`${this.name} recieved a notification to increment slides!`);
this.manualTransition(undefined, 1);
this.restartTimer();
break;
case 'SLIDE_DECREMENT':
Log.log(`${this.name} recieved a notification to decrement slide!`);
this.manualTransition(undefined, -1);
this.restartTimer();
break;
default:
//-----BOBBY CODE END
// Handle KEYPRESS events from the MMM-KeyBindings Module
if (notification === "KEYPRESS_MODE_CHANGED") {
this.currentKeyPressMode = payload;
}
// if (notification === "KEYPRESS") {
// console.log(payload);
// }
if (notification === "KEYPRESS" && (this.currentKeyPressMode === this.config.keyBindingsMode) &&
payload.KeyName in this.reverseKeyMap && payload.Sender === this.instance) {
if (payload.KeyName === this.config.keyBindings.NextSlide) {
this.manualTransition(undefined, 1);
this.restartTimer();
}
else if (payload.KeyName === this.config.keyBindings.PrevSlide) {
this.manualTransition(undefined, -1);
this.restartTimer();
}
else if (this.reverseKeyMap[payload.KeyName].startsWith("Slide")) {
var goToSlide = this.reverseKeyMap[payload.KeyName].match(/Slide([0-9]+)/i);
console.log((typeof goToSlide[1]) + " " + goToSlide[1]);
if (typeof parseInt(goToSlide[1]) === "number") {
this.manualTransition(parseInt(goToSlide[1]));
this.restartTimer();
}
}
}
},
but unfortunately it is not working. Do you have any idea why?