Need help with script for keymap

I’ve been using the Dvorak keyboard layout for many many years now. It’s now completely ingrained in my brain and I actually found a way to change all the blender keyboard shortcuts with just one script. I didn’t write the script; this is the original.

It’s worked beautifully for me so far, but now that I’m trying to do some video editing the shortcuts go nuts. It actually only happens when I turn on the Power Sequencer addon and I figured maybe the change from 2.79 to 2.8 (and now 2.9) changed some of the API calls for the script. The thing is… I don’t know anything about scripting in blender… So I don’t know if the right commands and lists are being modified.

Could someone help me out by checking out the script and telling me whether or not I need to make any changes?

Here’s the script:

(And thank you in advance for helping out…)

# Copyright 2015 Julian Sivertsen

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation. See <http://www.gnu.org/licenses/>.


import bpy


# Mapping between the Qwerty keys, and what keys they are replaced with
# when using Dvorak. In other words. Label of the key on the keyboard
# is on the left, and the key that is registered when pressing that key is
# on the right.

# This map has been converted for English Dvorak using an English (US) keyboard
conversion_map = {
    'A': 'A',
    'B': 'X',
    'C': 'J',
    'D': 'E',
    'E': 'PERIOD',
    'F': 'U',
    'G': 'I',
    'H': 'D',
    'I': 'C',
    'J': 'H',
    'K': 'T',
    'L': 'N',
    'M': 'M',
    'N': 'B',
    'O': 'R',
    'P': 'L',
    'Q': 'QUOTE',
    'R': 'P',
    'S': 'O',
    'T': 'Y',
    'U': 'G',
    'V': 'K',
    'W': 'COMMA',
    'X': 'Q',
    'Y': 'F',
    'Z': 'SEMI_COLON',
    'MINUS': 'LEFT_BRACKET',
    'EQUAL': 'RIGHT_BRACKET',
    'LEFT_BRACKET': 'SLASH',
    'RIGHT_BRACKET': 'EQUAL',
    'SEMI_COLON': 'S',
    'QUOTE': 'MINUS',
    'COMMA': 'W',
    'PERIOD': 'V',
    'SLASH': 'Z',
}


wm = bpy.context.window_manager


# Transform the keys using the conversion_map
for km in wm.keyconfigs.user.keymaps:
    for kmi in km.keymap_items:
        if kmi.key_modifier in conversion_map:
            kmi.key_modifier = conversion_map[kmi.key_modifier]
        
        if kmi.type in conversion_map:
            kmi.type = conversion_map[kmi.type]




# Ask the user for a name to save the preset as
bpy.ops.wm.keyconfig_preset_add('INVOKE_DEFAULT')