Yeah there are usually 3 pins on a microswitch Ground, Normally open (NO), Normally Closed (NC). I have Normally open and ground and i'm missing Normally Closed.
So should I connect 2 wires to ground and NO
You need to wire the 2 wires from the keyboard encoder to the button switch ( one will connect to the ground position and 1 to the NO position --- and each button will have 2 wires going to it -- you can not use a daisy chain for this type of matrix setup.
ie. lets say your keycode you traced for "5" (player 1 coin up) uses the red wire to the far left of the pic of the encoder and the yellow wire to the far right as the inputs (could be any combination of 2 wires as you traced just use those 2 wires) -- THen you would connect either the red or yellow wire to ground and th other one of the 2 to the NO position.
By doing this anytime the button is pressed those 2 wires are connected to each other which then signals the encoder that a connection of the 2 has been pressed. (same as if you had touched the 2 wires together.)
depending on the matrix some wires may go to several buttons ( ie. the red and yellow wire send a "5" and the red and blue wire send a "3" and the blue and yellow wire send a "1" ) in which case you will splice that wire to run to each button (this is one of the main reason people use encoders rather than keyboard hacks - as if 3 or 4 buttons are pressed at the same time they may make a combination for a 5th or 6th connection that gets sent to the game !! - ie. lets say for example - the button 1 has the red and yellow wire which sends a "5" and button 2 has the red and blue wire which sends a "3" and button 3 has the blue and yellow wire which sends a "1" key press code - IF you press both buttons 1 and 2 the game will get sent codes for button 3 as well since all 3 red, yellow, and blue wires have been connected. ) -- So when deciding which key presses are used try not to use the same wires too many times in the setup to avoid this esp. if using MAME or similar which allows pretty much any key code to be used - it is best to limit how many connections each wire is used for to avoid this ghosting.