Skip to content

Instantly share code, notes, and snippets.

@vvakame
Last active May 13, 2016 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vvakame/f77032004e12563797e561b997c05478 to your computer and use it in GitHub Desktop.
Save vvakame/f77032004e12563797e561b997c05478 to your computer and use it in GitHub Desktop.
ErgoDoz EZでLang1, Lang2が使えない件

qmk_firmwareを読み解く

わしゃ 英数/かな キーがどうしても使いたいんじゃ…!

用語メモ

  • LUFA - the Lightweight USB Framework for AVRs

気になる所メモ

  • common/keyboard.c
    • メインループっぽい?
  • common/action.c
    • process_action_kb 気になる
  • common/keymap.c
    • action_for_key とか
  • common/keyboard.c
    • keyboard_task がメインループに近い事がわかった
  • common/action.c
    • action_execのaction_tapping_processだ!
  • デバッグ方法
    • dprint? #include "debug.h" のやつ?
    • print と phex は使える。dprintf はなんか無視される。
    • MAGIC_KEY_DEBUG を有効に出来るとめっちゃ楽できそう… どうやるんだろう
SRC := keymaps/vv/keymap.c ergodox_ez.c twimaster.c matrix.c quantum/keymap_common.c quantum/led.c protocol/lufa/lufa.c protocol/lufa/descriptor.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.c protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.c common/host.c common/keyboard.c common/action.c common/action_tapping.c common/action_macro.c common/action_layer.c common/action_util.c common/keymap.c common/print.c common/debug.c common/util.c common/avr/suspend.c common/avr/xprintf.S common/avr/timer.c common/avr/bootloader.c common/bootmagic.c common/avr/eeconfig.c common/mousekey.c common/command.c common/sleep_led.c
keymaps/vv/keymap.c
ergodox_ez.c
twimaster.c
matrix.c
quantum/keymap_common.c
quantum/led.c
protocol/lufa/lufa.c
protocol/lufa/descriptor.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Class/Common/HIDParser.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Device_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/EndpointStream_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Endpoint_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Host_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/PipeStream_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/Pipe_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBController_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/AVR8/USBInterrupt_AVR8.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/ConfigDescriptors.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/DeviceStandardReq.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/Events.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/HostStandardReq.c
protocol/lufa/LUFA-git/LUFA/Drivers/USB/Core/USBTask.c
common/host.c
common/keyboard.c
common/action.c
common/action_tapping.c
common/action_macro.c
common/action_layer.c
common/action_util.c
common/keymap.c
common/print.c
common/debug.c
common/util.c
common/avr/suspend.c
common/avr/xprintf.S
common/avr/timer.c
common/avr/bootloader.c
common/bootmagic.c
common/avr/eeconfig.c
common/mousekey.c
common/command.c
common/sleep_led.c
$ system_profiler SPUSBDataType USB
USB:
USB 3.0 Bus:
Host Controller Driver: AppleUSBXHCILPTH
PCI Device ID: 0x8c31
PCI Revision ID: 0x0005
PCI Vendor ID: 0x8086
Apple Internal Keyboard / Trackpad:
Product ID: 0x0264
Vendor ID: 0x05ac (Apple Inc.)
Version: 2.25
Speed: Up to 12 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0x14400000 / 3
Current Available (mA): 1000
Current Required (mA): 40
Extra Operating Current (mA): 0
Built-In: Yes
BRCM20702 Hub:
Product ID: 0x4500
Vendor ID: 0x0a5c (Broadcom Corp.)
Version: 1.00
Speed: Up to 12 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0x14300000 / 2
Current Available (mA): 1000
Current Required (mA): 94
Extra Operating Current (mA): 0
Built-In: Yes
Bluetooth USB Host Controller:
Product ID: 0x8289
Vendor ID: 0x05ac (Apple Inc.)
Version: 1.18
Speed: Up to 12 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0x14330000 / 6
Current Available (mA): 1000
Current Required (mA): 0
Extra Operating Current (mA): 0
Built-In: Yes
ErgoDox ergonomic keyboard:
Product ID: 0x6028
Vendor ID: 0x1d50
Version: 1.00
Speed: Up to 12 Mb/sec
Manufacturer: unspecified
Location ID: 0x14200000 / 21
Current Available (mA): 1000
Current Required (mA): 100
Extra Operating Current (mA): 0
$ system_profiler SPUSBDataType USB
USB:
USB 3.0 Bus:
Host Controller Driver: AppleUSBXHCILPTH
PCI Device ID: 0x8c31
PCI Revision ID: 0x0005
PCI Vendor ID: 0x8086
Apple Internal Keyboard / Trackpad:
Product ID: 0x0264
Vendor ID: 0x05ac (Apple Inc.)
Version: 2.25
Speed: Up to 12 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0x14400000 / 3
Current Available (mA): 1000
Current Required (mA): 40
Extra Operating Current (mA): 0
Built-In: Yes
BRCM20702 Hub:
Product ID: 0x4500
Vendor ID: 0x0a5c (Broadcom Corp.)
Version: 1.00
Speed: Up to 12 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0x14300000 / 2
Current Available (mA): 1000
Current Required (mA): 94
Extra Operating Current (mA): 0
Built-In: Yes
Bluetooth USB Host Controller:
Product ID: 0x8289
Vendor ID: 0x05ac (Apple Inc.)
Version: 1.18
Speed: Up to 12 Mb/sec
Manufacturer: Apple Inc.
Location ID: 0x14330000 / 6
Current Available (mA): 1000
Current Required (mA): 0
Extra Operating Current (mA): 0
Built-In: Yes
ErgoDox EZ:
Product ID: 0x6028
Vendor ID: 0x1d50
Version: 0.01
Speed: Up to 12 Mb/sec
Manufacturer: ErgoDox EZ
Location ID: 0x14200000 / 23
Current Available (mA): 1000
Current Required (mA): 500
Extra Operating Current (mA): 0
@mhidaka
Copy link

mhidaka commented May 12, 2016

descriptor.cの

        HID_RI_USAGE_PAGE(8, 0x07), /* Keyboard */
        HID_RI_USAGE_MINIMUM(8, 0x00), /* Reserved (no event indicated) */
        HID_RI_USAGE_MAXIMUM(8, 0xFF), /* Keyboard Application */
        HID_RI_LOGICAL_MINIMUM(8, 0x00),
        HID_RI_LOGICAL_MAXIMUM(8, 0xFF),

        HID_RI_USAGE_PAGE(8, 0x07), /* Keyboard */
        HID_RI_USAGE_MINIMUM(8, 0x00), /* Reserved (no event indicated) */
        HID_RI_USAGE_MAXIMUM(8, 0x68), /* Keyboard Application */
        HID_RI_LOGICAL_MINIMUM(8, 0x00),
        HID_RI_LOGICAL_MAXIMUM(8, 0x68),

に変えてみて。動くと思う。

@vvakame
Copy link
Author

vvakame commented May 13, 2016

http://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-701.20.10/IOHIDSystem/IOHIDKeyboardDevice.cpp にApple KeyboardのgGenKeyboardDescがあるけど0xFFやな…??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment