#access pref in code

    prefs = bpy.context.preferences
    addon_prefs = prefs.addons[__name__].preferences

    addon_prefs.mkmouse_invert_buttons



#class property and panel draw for prefs

class My_addon_pref(bpy.types.AddonPreferences):
    bl_idname = __name__

    mkmouse_invert_buttons : bpy.props.BoolProperty(
        name="Invert buttons everywhere",
        default=False,
        )

    def draw(self, context):
        layout = self.layout
        layout.label(
            text="In all editor :")
        layout.label(
            text="Customization (save settings and restart Blender to apply changes)")
        layout.prop(self, "mkmouse_invert_buttons")



#insertion order in register (if keymap, else use "register, unregister = bpy.utils.register_classes_factory(classes)")

classes = (
    OBJECT_OT_curveArmatureOps,
    PANEL_PT_CurveRigPanel,
)

def register():
    if not bpy.app.background:
        from bpy.utils import register_class
        for cls in classes:
            register_class(cls)
        register_keymaps()

def unregister():
    if not bpy.app.background:
        from bpy.utils import unregister_class
        unregister_keymaps()
        for cls in reversed(classes):
            unregister_class(cls)