PS/2 Tastatur
Aus zerties.org
Eine kleine Dokumentation zu PS2 Tastaturen.
1) Dataport (DATA) 3) Ground (GND) 4) Voltageport (+5V) 5) Clock signal (CLK) 2 & 6) not connected (NC)
Ethersex kann die Ausgabe einer PS/2 Tastatur empfangen, und mit Control6 auswerten
CONTROL_START struct key_press key = PS2_GET(); if (key.keycode != 0) { dnl Taste wurde gedrückt if (key.data == 'l') PIN_TOGGLE(LICHT) } CONTROL_END
Die Struktur key_press enthält alle Daten und auch die Zustände der Sondertasten (CTRL, ALT)
struct key_press { uint8_t keycode; uint8_t data; /* modifiers */ uint8_t ctrl:1; /* Ist 1 wenn CTRL Taste gedrückt ist */ uint8_t alt:1; uint8_t lin:1; /* Windows Taste */ uint8_t num:1; uint8_t shift:1; uint8_t extended:1; /* Extended Keymap, (Pfeiltasten, etc.) */ };

