skai2 / EDAutopilot

Elite Dangerous computer vision based auto-navigation including long range routing
MIT License
151 stars 67 forks source link

Key error: DIK_LEFTBRACKET #60

Open Thurion666 opened 2 years ago

Thurion666 commented 2 years ago
INFO     RELEASE=v19.05.15-alpha-18
INFO     PATH_LOG_FILES=None
INFO     PATH_KEYBINDINGS=None
INFO     KEY_MOD_DELAY=0.01
INFO     KEY_DEFAULT_DELAY=0.2
INFO     KEY_REPEAT_DELAY=0.1
INFO     FUNCTION_DEFAULT_DELAY=0.5
INFO     SCREEN_WIDTH=1920
INFO     SCREEN_HEIGHT=1080
INFO     get_latest_log=C:\Users\Thurion\Saved Games\Frontier Developments\Elite Dangerous\Journal.220209140252.01.log
INFO     get_latest_keybinds=C:\Users\Thurion\AppData\Local\Frontier Developments\Elite Dangerous\Options\Bindings\Custom.3.0.binds
Traceback (most recent call last):
  File "D:\EDAutopilot\autopilot.py", line 1, in <module>
    from dev_tray import tray
  File "D:\EDAutopilot\dev_tray.py", line 3, in <module>
    from dev_autopilot import autopilot, resource_path, get_bindings, clear_input, set_scanner, RELEASE
  File "D:\EDAutopilot\dev_autopilot.py", line 372, in <module>
    keys = get_bindings()
  File "D:\EDAutopilot\dev_autopilot.py", line 354, in get_bindings
    binding['key'] = SCANCODE[binding['pre_key']]
KeyError: 'DIK_LEFTBRACKET'

Welp, i've been trying for so long now, but i can't get past this single error.

SumZer0-git commented 2 years ago

I don't use the left bracket in my bindings and thus didn't run into this. You will have to add it to get_bindings() routine

    convert_to_direct_keys = {
        'Key_LeftShift':'LShift',
        'Key_RightShift':'RShift',
        'Key_LeftAlt':'LAlt',
        'Key_RightAlt':'RAlt',
        'Key_LeftControl':'LControl',
        'Key_RightControl':'RControl',
        'Key_LeftBracket':'LBracket',
        'Key_RightBracket':'RBracket'
    }

DIK_LBracket, so you are missing this special conversion, I added the right bracket too for completeness. I'm pretty sure this is it