It looks like I need to add a few unassigned scancodes to properly deal with my ISO modded F AT (as per http://www.seasip.info/VintagePC/ibm_6450225.html I'd need 13, 19, 39, 53, 78; ANSI mod would need 5C instead of 53). Hitting build errors with at the moment, having to do with missing declarations, can't figure out what macro is tripping me up.
make -f Makefile.rev2 KEYMAP=plain
-------- begin --------
avr-gcc (GCC) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mkdir -p obj_ps2_usb_rev2
Compiling C: keymap_plain.c
avr-gcc -c -mmcu=atmega32u4 -gdwarf-2 -DF_CPU=16000000UL -DSUSPEND_MODE_STANDBY -DBOOTLOADER_SIZE=4096 -DPS2_USE_INT -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DNKRO_ENABLE -DVERSION=91810911-dirty -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_ps2_usb_rev2/keymap_plain.lst -I. -I../../tmk_core -I../../tmk_core/protocol -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config_rev2.h -MMD -MP -MF .dep/obj_ps2_usb_rev2_keymap_plain.o.d keymap_plain.c -o obj_ps2_usb_rev2/keymap_plain.o
In file included from keymap_plain.c:1:0:
keymap_common.h:132:17: error: 'KC_K19' undeclared here (not in a function); did you mean 'KC_F19'?
{ KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_NO }, \
^
keymap_common.h:172:1: note: in expansion of macro 'KEYMAP_ALL'
KEYMAP_ALL( \
^~~~~~~~~~
keymap_common.h:198:1: note: in expansion of macro 'KEYMAP_FULL'
KEYMAP_FULL( \
^~~~~~~~~~~
keymap_plain.c:21:5: note: in expansion of macro 'KEYMAP'
KEYMAP(
^~~~~~
keymap_common.h:136:17: error: 'KC_K39' undeclared here (not in a function); did you mean 'KC_K19'?
{ KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_NO }, \
^
keymap_common.h:172:1: note: in expansion of macro 'KEYMAP_ALL'
KEYMAP_ALL( \
^~~~~~~~~~
keymap_common.h:198:1: note: in expansion of macro 'KEYMAP_FULL'
KEYMAP_FULL( \
^~~~~~~~~~~
keymap_plain.c:21:5: note: in expansion of macro 'KEYMAP'
KEYMAP(
^~~~~~
keymap_common.h:139:37: error: 'KC_K53' undeclared here (not in a function); did you mean 'KC_K39'?
{ KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_NO, KC_##K57 }, \
^
keymap_common.h:172:1: note: in expansion of macro 'KEYMAP_ALL'
KEYMAP_ALL( \
^~~~~~~~~~
keymap_common.h:198:1: note: in expansion of macro 'KEYMAP_FULL'
KEYMAP_FULL( \
^~~~~~~~~~~
keymap_plain.c:21:5: note: in expansion of macro 'KEYMAP'
KEYMAP(
^~~~~~
keymap_common.h:140:47: error: 'KC_K5C' undeclared here (not in a function); did you mean 'KC_K53'?
{ KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_NO, KC_##K5F }, \
^
keymap_common.h:172:1: note: in expansion of macro 'KEYMAP_ALL'
KEYMAP_ALL( \
^~~~~~~~~~
keymap_common.h:198:1: note: in expansion of macro 'KEYMAP_FULL'
KEYMAP_FULL( \
^~~~~~~~~~~
keymap_plain.c:21:5: note: in expansion of macro 'KEYMAP'
KEYMAP(
^~~~~~
make: *** [../../tmk_core/rules.mk:560: obj_ps2_usb_rev2/keymap_plain.o] Error 1
I tried a very dirty workaround by modifying the KEYMAP_ALL array, but my goal is to have something clean that won't require forking the existing converter code.
Ideas?
Thanks,
Darkshado
Posted: 31 Dec 2017, 10:48
by Laser
In my (limited) understanding, you would have to define your own macro, eg. KEYMAP_MYKBD, similar to how KEYMAP_ALL, KEYMAP_ISO etc. are defined in keyboard_common.h, but including all the needed scan codes for your keyboard, and use that macro instead of KEYMAP_ALL. Also, it could be probably useful to look in the keyboard_common.h file included in the other converters that come with TMK, not only ps2_usb - maybe you can find a macro closer to your specs.
Since you already modified KEYMAP_ALL, just undo that, and move your modifications to a new macro - i.e. create a new macro - it can even be in your keymap_xxx.c file (which you have to modify anyway), and use it instead of KEYMAP_ALL.
Posted: 31 Dec 2017, 21:28
by Darkshado
Except for 13, the other matrix positions in KEYMAP_ALL are all assigned to KC_NO instead of their scan codes; this prevents "chaining" into simplified maps as done with KEYMAP or KEYMAP_JIS. I'll push what I've got on GitHubsometime tomorrow [edit: now].
There are at least two possible approaches here: allow the existing code to deal with unassigned codes, such a converter could be programmed with layers remapping them to something useful, it would work with both standard PS/2 boards (e.g. Model M, unmodified Model F AT) as well as ANSI or ISO modded F AT ones on another layer. The standard PS/2 KEYMAP(_ISO or _JIS) layer would simply discard the unassigned codes.
The other, closer to what I've done so far, is to effectively create a new converter specifically for modded F AT keyboards, by modifying the codes output by the KEYMAP_ALL matrix. I'm not convinced this is the better approach from a code maintenance perspective since the F AT otherwise uses Set 2. Besides, my current stuff changes KEYMAP_ALL directly to my particular layout, completely breaking usability with everything else.
Posted: 02 Jan 2018, 00:06
by Laser
Maybe talk to Hasu directly, at the "dedicated" thread.
Posted: 03 Jan 2018, 09:20
by Darkshado
Got a reply from Hasu, paid closer attention to the error messages, go it to work, submitted pull request 509.
Enjoying the "music" at the moment
Thanks,
Darkshado
Posted: 03 Jan 2018, 10:56
by hasu
Hey,
I just realised that the PC/AT keyboard uses scan code set 3, not set 2 which normal ps/2 keyboards use, according to john elliot, as you referred. http://www.seasip.info/VintagePC/ibm_6450225.html
Terminal converter should work with keyboard with code set 3, did you try it before working on ps/2 converter? It seems to support those questioned scan codes from the begining. https://github.com/tmk/tmk_keyboard/tre ... rminal_usb
That being said, it seems set 3 and set 2 are very similar and can be handled with one unified converter easily. It would be better than maintaining two separate converters. Thanks for the heads-up and PR. https://github.com/tmk/tmk_keyboard/issues/510
Posted: 03 Jan 2018, 19:15
by Darkshado
I had not looked at the Set 3 terminal converter yet, I plan to do it soon since I also have an F-122 to take care of. Hadn't picked up that detail on the page, would have saved me some work
I'll have to check the documentation/code to understand the nuances differentiating KEYMAP and UNIMAP macros.