Skip to content

Commit

Permalink
Merge pull request #2 from an-achronism/bugfix/e0-remap
Browse files Browse the repository at this point in the history
E0 remapping corrected + added Unicomp New Model M Pause/Break key workaround
  • Loading branch information
purdeaandrei authored Mar 6, 2023
2 parents 14ec1e6 + 27e319e commit 490e261
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
3 changes: 1 addition & 2 deletions keyboards/converter/ibmpc_usb/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRODUCT_ID 0x6536
#define DEVICE_VER 0x0101
#define MANUFACTURER QMK
#define PRODUCT Legacy Keyboard Convert
#define DESCRIPTION convert IBM PC keyboard to USB
#define PRODUCT IBM keyboard protocol converter

/* matrix size */
#define MATRIX_ROWS 8
Expand Down
20 changes: 15 additions & 5 deletions keyboards/converter/ibmpc_usb/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,21 +801,31 @@ static int8_t process_cs1(uint8_t code)
static uint8_t cs2_e0code(uint8_t code) {
switch(code) {
// E0 prefixed codes translation See [a].
case 0x11: return 0x0F; // right alt
case 0x14: return 0x17; // right control
case 0x1F: return 0x19; // left GUI
case 0x11: if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id)
return 0x13; // Hiragana(5576) -> KANA
else
return 0x0F; // right alt

case 0x41: if (0xAB90 == keyboard_id || 0xAB91 == keyboard_id)
return 0x7C; // Keypad ,(5576) -> Keypad *
else
return (code & 0x7F);

case 0x14: return 0x19; // right control
case 0x1F: return 0x17; // left GUI
case 0x27: return 0x1F; // right GUI
case 0x2F: return 0x5C; // apps
case 0x2F: return 0x27; // apps
case 0x4A: return 0x60; // keypad /
case 0x5A: return 0x62; // keypad enter
case 0x69: return 0x27; // end
case 0x69: return 0x5C; // end
case 0x6B: return 0x53; // cursor left
case 0x6C: return 0x2F; // home
case 0x70: return 0x39; // insert
case 0x71: return 0x37; // delete
case 0x72: return 0x3F; // cursor down
case 0x74: return 0x47; // cursor right
case 0x75: return 0x4F; // cursor up
case 0x77: return 0x00; // Unicomp New Model M Pause/Break key fix
case 0x7A: return 0x56; // page down
case 0x7D: return 0x5E; // page up
case 0x7C: return 0x7F; // Print Screen
Expand Down

0 comments on commit 490e261

Please sign in to comment.