Controlling Slider in Pavlovia with keyboard

Update on this: I finally managed to get this to work, with the following code snippet:

arrowKeys = psychoJS.eventManager.getKeys({keyList:['left', 'right']});
if (arrowKeys.includes('left')) {
    slider_practice._recordRating(slider_practice.getRating()-1);
    }
if (arrowKeys.includes('right')) {
    slider_practice._recordRating(slider_practice.getRating()+1);
    }

Also, in the Begin Routine the value is preset to the default value to make things easier for the subjects, and also to prevent None-values:

slider_practice._recordRating(4.0);

The entire (test case) code is viewable here: https://gitlab.pavlovia.org/jennisaaristo/slider_test .