You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

README 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. PS/2 to USB keyboard converter
  2. ==============================
  3. This firmware converts PS/2 keyboard protocol to USB.
  4. Demostration build
  5. ------------------
  6. In this demo build, you can try several layouts,
  7. mouse keys and USB NKRO.
  8. Special keys:
  9. Magic+0: Qwerty with mouse keys(default)
  10. Magic+1: Qwerty
  11. Magic+2: Colemak
  12. Magic+3: Dvorak
  13. Magic+4: Workman
  14. Magic+N: toggles NKRO/6KRO(6KRO by default)
  15. Magic+Esc: sends Power Event
  16. where Magic=(LShift+RShift) or (LControl+RShift)
  17. Keybinds:
  18. Fn0+(hjkl): Mouse key move(vi cursor)
  19. Fn0+(yuio): Mouse wheel(left,down,up,right)
  20. Fn0+space: Mouse button1
  21. Fn0+(mnb): Mouse buttons(1,2,3)
  22. Fn0+(zxc): Media control(Volup, Voldown, Mute)
  23. Fn1+(hjkl): Cursor move(vi cursor)
  24. Fn1+(nm,.): Cursor move(Home,PageDown,PageUp,End)
  25. Fn2+(esdf): Mouse key move(invert T cursor)
  26. Fn2+(qwrt): Mouse wheel(left,down,up,right)
  27. Fn2+space: Mouse button1
  28. Fn2+(,./): Media control(Volup, Voldown, Mute)
  29. where Fn0=;, Fn1=/, Fn2=a
  30. Features
  31. --------
  32. Mouse keys
  33. You can emulates mouse move and button click using keyboard.
  34. System/Media control
  35. You can sends Power event, Volume down/up and Mute.
  36. USB NKRO(actually 120KRO+8Modifiers)
  37. You can tolggles NKRO/6KRO.(Not tested on Mac.)
  38. Keymap customization
  39. You can customize keymaps easily by editing source code.
  40. Build for Teensy
  41. ----------------
  42. 0. Connect PS/2 keyboard to Teensy by 4 lines(Vcc, GND, Data, Clock).
  43. 1. Define following macros for PS/2 connection in config_pjrc.h:
  44. PS2_DATA_PORT
  45. PS2_DATA_PIN
  46. PS2_DATA_DDR
  47. PS2_DATA_BIT
  48. PS2_CLOCK_PORT
  49. PS2_CLOCK_PIN
  50. PS2_CLOCK_DDR
  51. PS2_CLOCK_BIT
  52. 2. Edit Makefile for build options and MCU setting.
  53. 2. make
  54. 3. program Teensy.
  55. http://www.pjrc.com/teensy/loader.html
  56. Build for V-USB
  57. ---------------
  58. 0. Build V-USB controller board and connect PS/2 keyboard.
  59. 1. Define macros in config_vusb.h if needed.
  60. 2. Edit Makefile.vusb for build options and MCU setting.
  61. 3. make -f Makefile.vusb
  62. 4. program your V-USB controller.
  63. V-USB Circuit
  64. -------------
  65. +---+ +---------------+
  66. USB GND | | ATmega168 |
  67. === C3 | |
  68. 5V <-------+--------+---|Vcc,AVCC | PS/2
  69. R1 | | ====
  70. D- <----+--+-----R2-----|INT1 RXD|------->DATA
  71. D+ <----|---+----R3-----|INT0 XCK|------->CLOCK
  72. Z1 Z2 | | ->5V
  73. GND<----+---+--+--+-----|GND | ->GND
  74. | | | |
  75. | C2-+--|XTAL1 |
  76. | X1 | |
  77. +--C3-+--|XTAL2 |
  78. +---------------+
  79. R1: 1.5K Ohm
  80. R2,R3: 68 Ohm
  81. Z1,Z2: Zenner 3.6V
  82. C1,C2: 22pF
  83. C3: 0.1uF
  84. X1: Crystal 20MHz(16MHz/12MHz)
  85. Keymap
  86. ------
  87. You can change a keymap by editing code of keymap.c like following.
  88. How to define the keymap is probably obvious. You can find key
  89. symbols in usb_keycodes.h.
  90. If you want to define more than one keymap, see hhkb/keymap.c and
  91. macway/keymap.c as examples. To define keymap(layer) switching may
  92. needs a bit of your effort at this time.
  93. /* Default Layer: plain keymap
  94. * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------.
  95. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak|
  96. * `---' `---------------' `---------------' `---------------' `-----------' `-----------'
  97. * ,-----------------------------------------------------------. ,-----------. ,---------------.
  98. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -|
  99. * |-----------------------------------------------------------| |-----------| |---------------|
  100. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| |
  101. * |-----------------------------------------------------------| `-----------' |-----------| +|
  102. * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| |
  103. * |-----------------------------------------------------------| ,---. |---------------|
  104. * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
  105. * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
  106. * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| |
  107. * `-----------------------------------------------------------' `-----------' `---------------'
  108. */
  109. KEYMAP(
  110. ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, PWR, F13, F14,
  111. GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
  112. TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9,
  113. CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS,
  114. LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3,
  115. LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
  116. ),
  117. EOF