So here is what I get as an output which takes 6 loops for one encoder detent in the Clockwise Rotation.
LOOP 1
Encoder 27 28 -- This is the correct encoder Pair as defined in // Determine Active Encoder A or B
Encoder State 1 -- This is the correct Pressed State for button 28 (encoder output B)
A Encoder Found = -1 -- This seems right, however,further output issues indicate otherwise
B Encoder Found = -1 -- I would expect this to be "0" or "28" as Button 28 is pressed
Encoder Button 28 is pressed -- This is the correctly determined Button State for this loop
LOOP 2
Encoder 27 28 -- This is the correct encoder Pair as defined in // Determine Active Encoder A or B
Encoder State 1 -- This is the correct Pressed State for button 27 (encoder output A)
A Encoder Found = -1 -- I would expect this to be "1" or "27" as Button 27 is pressed
B Encoder Found = -1 -- I would expect this to be "0" or "28" as Button 28 is still pressed
Encoder Button 27 is pressed -- This is the correctly determined Button State for this loop
LOOP 3
Encoder 27 28 -- This is the correct encoder Pair as defined in // Determine Active Encoder A or B
Encoder State 3 -- This is the correct Released State for button 28 (encoder output B)
A Encoder Found = -1 -- I would expect this to be "1" or "27" as Button 27 is still pressed
B Encoder Found = -1 -- I would expect this to be "0" or "28" as Button 28 is being released
Encoder Button 28 is released -- This is the correctly determined Button State for this loop
LOOP 4
Encoder 27 28 -- This is the correct encoder Pair as defined in // Determine Active Encoder A or B
Encoder State 0 -- This is the correct Idle State for button 28 (encoder output B)
A Encoder Found = -1 -- I would expect this to be "1" or "27" as Button 27 is still pressed
B Encoder Found = -1 -- I would expect this to be "-1" as Button 28 is Idle
Encoder Button 28 is idle -- This is the correctly determined Button State for this loop
LOOP 5
Encoder 27 28 -- This is the correct encoder Pair as defined in // Determine Active Encoder A or B
Encoder State 3 -- This is the correct Released State for button 27 (encoder output A)
A Encoder Found = -1 -- I would expect this to be "1" or "27" as Button 27 is being released
B Encoder Found = -1 -- I would expect this to be "-1" as Button 28 is Not Active
Encoder Button 27 is released -- This is the correctly determined Button State for this loop
LOOP 6
Encoder 27 28 -- This is the correct encoder Pair as defined in // Determine Active Encoder A or B
Encoder State 0 -- This is the correct Idle State for button 27 (encoder output A)
A Encoder Found = -1 -- I would expect this to be "-1" as Button 27 is Idle
B Encoder Found = -1 -- I would expect this to be "-1" as Button 28 is Not Active
Encoder Button 27 is idle -- This is the correctly determined Button State for this loop
I am probably off in what I think the findInList() outputs are for Idle but I know they should probably change from being returned as -1 (or not in list for every loop). I have done another test program which uses basically the same code but is carried in an Event handler (without the switch) where it actually does give me correct findInList() outputs so I am really quite confused..
I have tried changing the Variable type = Byte constantly outputs 255, Int constantly outputs -1, and char constantly outputs a Diamond with a ? in it.
I belive that if I can track the state of the paired buttons through the loops with the findInList() I should be able to determine the point at which to trigger a single actual HID Joystick button output. This should also allow me to not get the encoder positions in list confused if another input is detected such as a button press placing itself between the Encoder A and Encoder B in the active encoder list.
Any help would be greatly appreciated.. I have this feeling I am just missing something REALLY small such as the placement of things in the loops or a variable type or something that I should have been able to figure out but have just NOT yet.