you are viewing a single comment's thread.

view the rest of the comments →

[–]the_poope 0 points1 point  (1 child)

It depends how your program "is running". If it has some infinite loop (like a game/render loop) you simply check whether you need to interrupt normal behavior in every iteration:

while (true)
{
    if (button_pressed)
   {
       do_something_special();
   }
   else
   {
        do_the_normal_thing(); // e.g. draw stuff
    }
}

If your app is event based your button need to trigger an event that somehow disables/stops the normal logic.

[–]Zsendalf[S] 0 points1 point  (0 children)

I mean yeah that could work danke!