hdiutil and keyboard mappings

Is anyone aware of a diagnostic tool that will show USB keycodes when physically pressing keys on a iMac Bluetooth keyboard?


I'm trying to adjust my keymap for Emacs, however am having a challenging time on the OSX side. I was referred to this tool to adjust it according to well defined codes that the USB consortium maintains. I'm hoping a tool will show me the existing codes for each key vs me going through trial and error.


hidutil property —set ‘{“UserKeyMapping”:[{HIDKeyboardModifierMappingSrc: 0xHIDSRC, “HIDKeyboardModifierMappingDst”: 0xHIDDST, …}.


Thank you!