Keypad .kstate question

UPDATE:

I have finally figured out everything I wanted to do.. It turns out that the Runtime Keypad adjustments were staring me in the FACE in my Encoder portion.. As it turns out that I could use the same matrix but just create an exclusion list so that certain Keypresses were mapped to one sub program and certain cypresses were mapped to a different program.. so IE if buttons above a certain number were pressed they were sent to the encoder portion of the code were if they were lower I could send it to the Button portion and then all I had to do was alter that cutoff point based on another condition.. So I was able to reduce 9 Different matrixes with overlapping functionality into 2 matrixes with non overlapping programming..

I went from 450 lines to 200 lines of code and save 2% storage space and 17% of Memory on my controller so i think it was a success..

Thank you for all of your help. I don't think I could have gotten things the way they are without your help in understanding exactly how the KeyPad Library worked.

I will mention that the encoder code is NOT perfect, If the encoder is turned really fast I do get an error here and there and I had to use some error rejection programming to get it to work with extremely limited erring but I think that is more due to the fact I am running it onto of the KeyPad Library Rather than doing the Encoder decoding at the Pin Level where I could use something like the Buxtronix State Table Decoding.