This morning my head is a little more awake and the solution to your problem is rather simple. Just use 1 side of your switches so it's either on or off and do the edge detection in software. Edge detection is easy in software. Assuming your keyboard routine returns a 32 bit variable with 1 bit for each switch, to find changed switches xor the current switch state with the previous state - any 1 bits are the switches that toggled.
Thanks a lot for this idea! I swear to god that every time I came across a problem in electronics so far, it turned out to be very simple and I was just overcomplicating things. This is just another one to add that the list.
I have tried software edge detection before, a little bit differently because I ran a function for each button instead of gathering information about all of them and then executing code based on that. Your approach is very interesting and I might end up implementing it in the end because its very neat!
The way to detect key presses and releases is also very good because allows you to know the position of a push button as well. Thanks for that!
I was going to say this in #22.
You can edge detect using the interrupt system, and you dont need to actually have interrupts, you can poll the interrupt bit to see if a change has occurred even with interrupts off.