How can I turn a Keyboard's buttons into switches? (Embedded Sys)

  • Thread starter Bizantium
  • Start date
  • Tags
    Switches
In summary: The article on the wiki suggests to ground a specific port on a MCU to receive the scan codes from the keyboard.
  • #1
Bizantium
2
0
I'm working on a project in my job, but being only a student in CE and Comp. Sci. I'm limited in knowledge.

I'm looking for a way to communicate with an arcade game, with a standard PS/2 Keyboard. Eliminating the standard joystick and buttons and using a keyboard instead. What would be the best and efficient way into tapping into PS/2 data and clock signals and get them to act as a switch? Where " W " key is UP, S is down, etc etc.

Basically I'm looking for the complete opposite of a Keyboard Encoder, which I imagine would be a Decoder. I've seen some Atmel chips that will do the job but I'm just not sure if there's another more easier way? As of now, what I do is rip the keyboard open and rewire it. This method is time consuming and I know there's something like a Decoder where the ASCII signals can be tapped into with much ease, and I can reprogram them to have them act as switches..

Any insight?
 
Computer science news on Phys.org
  • #2
PC keyboards generate scan codes, you can start with this wiki article:

http://en.wikipedia.org/wiki/Scancode

I'm not sure what you'd need to provide an interface to power the keyboard and received the scan codes.
 
  • #3
Yeah the interface is mainly what I'm looking for in this case. I know each key has their own code, and the keyboards vary with their signals and it all gets interpreted by the computer ( our home PC ). But when It comes to embedded systems I can see that things get more complex.

If I am not mistaking each keyboard would have to be programmed differently in this sense if I were to make each key act as a switch. An IBM keyboard would give it's signals from key A, and a Logitech Keyboard ( both PS/2 ) would give off it's own unique signal for letter A?

Or if there's anybody here that can confirm to me logically or by experience that an MCU can can read these signals without having to actually #define them and layout the entire matrix? If so, can a simple If() statement be used to ground a specific unique port for different characters?
 
  • #4
Bizantium said:
An IBM keyboard would give it's signals from key A, and a Logitech Keyboard ( both PS/2 ) would give off it's own unique signal for letter A?
All PC keyboards use the same scancodes, although some have have more keys and more scan codes than other keyboards. The scancodes for w a s d would be the same for any PC keyboard. Link from the wiki article about interfacing with a PC keyboard:

http://www.beyondlogic.org/keyboard/keybrd.htm
 
Last edited:
  • #5


There are a few different ways you could approach this problem, depending on your specific goals and the resources available to you. Here are a few potential solutions that may be helpful:

1. Use a keyboard encoder: As you mentioned, there are chips available that can convert keyboard signals into switch signals. These chips are designed specifically for this purpose and can be programmed to map specific keyboard keys to specific switch actions. This may be the most straightforward and efficient solution for your project.

2. Use a microcontroller: If you have some experience with programming and electronics, you could use a microcontroller (such as an Arduino) to read the keyboard signals and then output switch signals accordingly. This would require some coding and circuit design, but it could give you more flexibility in terms of customizing the switch actions and mapping.

3. Use a keyboard emulator: Another option is to use a keyboard emulator, which is a device that can simulate keyboard inputs. You could program the emulator to send specific keyboard commands when triggered by a switch, essentially allowing you to use the switches as keyboard keys. This may be a more complicated solution, but it could be useful if you need to interface with multiple devices that require keyboard inputs.

Ultimately, the best solution will depend on your specific project requirements and the resources available to you. I recommend doing some research and potentially reaching out to other engineers or hobbyists who have tackled similar projects for advice and guidance. Good luck!
 

1. How do I physically turn a keyboard's buttons into switches?

To turn a keyboard's buttons into switches, you will need to open up the keyboard and identify the circuit board responsible for registering key presses. Then, you will need to solder wires to the buttons and connect them to an external switch. This will allow you to physically press the external switch to register a key press.

2. Can I use any type of switch to replace the buttons on a keyboard?

It is important to use a switch that is compatible with the keyboard's circuit board. Some keyboards may have specific requirements for the type of switch used. It is recommended to research the keyboard and its circuit board before selecting a switch to ensure compatibility.

3. Will turning a keyboard's buttons into switches affect its functionality?

Yes, turning a keyboard's buttons into switches will change how the keyboard functions. The external switches will need to be pressed in order to register key presses, rather than pressing the buttons on the keyboard itself. This may take some time to adjust to, but the overall functionality of the keyboard should not be significantly impacted.

4. Can I turn any keyboard into a switch keyboard?

Not all keyboards are designed to have their buttons turned into switches. It is important to research the keyboard and its circuit board before attempting to modify it. Additionally, certain keyboards may not be compatible with certain types of external switches, so compatibility should also be considered.

5. Is it possible to reverse the modification and revert the keyboard back to its original state?

Yes, it is possible to reverse the modification and revert the keyboard back to its original state. However, this may require desoldering the wires and removing the external switches, and it is not a guaranteed process. It is important to carefully consider the modification before making any changes to the keyboard.

Similar threads

Replies
37
Views
3K
  • Electrical Engineering
Replies
10
Views
3K
Replies
11
Views
3K
Replies
18
Views
5K
  • Electrical Engineering
Replies
7
Views
11K
  • STEM Academic Advising
Replies
4
Views
2K
Back
Top