Staircase - conceptual question

This is a really basic question - and I feel embarrassed to ask it… but here goes (any shred of self-respect just flying out the window). With the simple staircase procedure as part of a loop around some stimulus, I can make an assessment of whether the answer was correct or incorrect (according to criteria in a code block), but how do I feedback to the staircase loop what the outcome was - to determine whether it should increase/decrease/reverse etc? It seems like all the parameters, step sizes etc are under the loop dialogue, but I’m missing how to feedback to it…

For background, I’m presenting a stimulus, asking the subjects to rate it using a slider, then depending on the answer either increase or decrease intensity. e.g. greater than 5 => correct (decrease intensity), less than/equal to 5 => incorrect (increase intensity).

Please go easy on me!

Cheers, Jon

Just to follow up on this - I get that most/all staircase procedures have binary keyboard input, and that this will determine the up/down response … but when the response is based on a slider is it still possible to interact with the staircase code (expecting a keypress)…?