how to maximize gamepad buttons !!

how to maximize gamepad buttons !!

hello,

i had a problem with glovepie, you can see the developments here

with help, i was able to solve the problem but realised that the hat-switch code only has 4 directions, so the diagonals where not working, for example instead of up/left directions there is up and left directions press simultaneously.

so there is a need to have more code to cancel individual directions when both directions are pressed.

so i’ve realize that in glovepie there is the possibility of controlling button combinations, this can be very useful by itself, for combos, shift keys, etc…

but there is also the possibility of expanding the number of buttons of a gamepad.

a ps2 usb type gamepad will have +/- 12 buttons and 4 directions

there is a big number of possible combinations for just this buttons

there is also the possibility of using a button matrix, for instance, in my project i have 30 buttons and two gamepads, with a matrix i could have only one gamepad, because i would only need 11 contacts

maybe i will work on my layout so i can have extra encoders…

that’s it

:slight_smile:

Wow this sounds great!

How many possible combinations?

Do you have to wire the buttons differently?

I’ve never heard of this feature in Glovepie… is this a breakthrough that these forums were unaware of and you just discovered?

i guess you’re referring to my code to send out a 3rd value and not the original two when two buttons are held down?

it might be useful for other things - the only issue is what i always mentioned on the other thread.

if you press down buttons A+B together and you want midi(C) to be send out and not midi(A) or midi(B) i suspect that you will won’t be able to press buttons A+B at exactly the same time so whichever button gets pressed first will end up sending out an ON message followed by an OFF very soon afterwards. this may or may not be an issue depending on what buttons A+B are setup individually to send out/affect in traktor etc.

i agree it could open up some interesting possibilities though as well as sending out A+B+C at the same time for a more midifighter type combo.

what i’m saying is in therms of a matrix, every button is always connected to 2 contacts

on a simple matrix

…A…B…C…D
1…A1…B1…C1…D1
2…A2…B2…C2…D2
3…A3…B3…C3…D3
4…A4…B4…C4…D4

you only press the combination of two contacts, so there is no problem for what contact is pressed first

ah… cunning. i am no kind of hardware guy but i think i see what you mean.

if can wire a button to the contact so you know it will always press the other two buttons at the exact same time then yep - cool idea.

just needs to be laid out in some way so you know pressing A or B isn’t going to do anything while you’re pressing C ofc.

what happens when you press more than one button on your matrix at a time? might cause trouble!

pressing more ‘matrix’ buttons should act as expected - the only issue i think is that if you press one of these matrix/combo buttons then you cant also press the individual ones - they wont work

theoretical if you press more than one button it doesn’t matter, since you don’t have individual buttons, all the buttons are a combination of two contacts…

the problem is that you may need a lot more code to cover all possible combinations that could compromise the buttons pressed already pressed…

this is the example, any button pressed will always be a combination of two contacts, from a row and a column, the difference is that the decoding would be made in glovepie

ah… no individual buttons… that makes sense now. i am very skilled at being extremely dumb sometimes :slight_smile:

it is possible but there is a big problem surely… you can’t press more than one button at once - else the code can’t know for sure which buttons have been pressed.

for example if you took this 4x4 grid where the * indicated button presses, these two combinations would register the same:

A  B  C  D
W    *
X
Y
Z *

A  B  C  D
W *
X
Y
Z    *

e.g: pressing AZ and BW can’t be distinguised from AW and BZ or even pressing all 4 at the same time ofc.

so it could be a great idea but only if just one button from the grid was to be used at one time? or am i still missing something?

it is a cool way of converting 8 buttons into 16 though - or even 16 into 64… the glovepie code wouldnt be too much of a pain

tho ofc pressing multiple buttons manually would register at slightly different times, so if the code knew that first AZ was pressed and then real buttons B and W got triggered that most likely means that the combo button BW just got pressed - assuming that glovepie scans the button input faster then the interval between the different buttons being pressed. i saw somewhere it saying it runs the script approx 60 times a second or something?

and about the use of diodes? could it help?

don’t think so - but i’m not a hardware guy…

for multiple buttons pressed at the same time the system would have to rely on buttons being pressed sequentially - even if you think you press them at the same time the chances are they’re not quite being pressed at exactly the same time.

the code would then just have to compare what it knew was pressed before with what it being pressed now and hopefully only one new combo button has been pressed or released and then it can work out what the change is.

though maybe wiring up a second gamecontroller is all in all less work - who knows…

well, even if it’s not 100% ideal, it could help someone in the future, like it did with me, with the use of two rotary encoders with switches, using only two contacts…

:slight_smile:

oh yep definately. it certainly has the potential to be quite useful…

zestoi, look here…

the problem and the solution (with diodes has i mentioned) :wink:

http://pcbheaven.com/wikipages/How_Key_Matrices_Works/

it’s the same principle

it is and it isn’t :wink: that is working at the hardware level when i was only talking about using the technique somehow in glovepie/software.

in glovepie we only know at any instant what buttons are pressed (real buttons/contacts). in that example you pasted they have a real advantage over that… since they can just send a signal to A and then check 1,2,3,4 etc, then do the same with B,C and D. repeating this very fast every second…

so yep - then diodes will help as then that helps stops the signal flowing where it shouldn’t be.

in glovepie we arent only sampling 1,2,3,4 when the signal is high on only one of A,B,C,D ofc - that’s the big difference.

but that web page was really interesting - i didn’t know how that worked before :slight_smile:

whether that method could be ported to a gamepad type solution with or without custom glovepie type code though? i have no clue…