# 2.8 Shortcut to turn on/off “Emulate 3 Button Mouse”..?

Could use some insight please, I am not sure how to properly formulate this question (brand new to 3D and Blender 2.8). After reading up on various forums there maybe a way to reprogram a keymap shortcut for the ALT key?

I prefer having the "emulate 3 Button Mouse" checked for general tumbling/navigation so I don't have to use the MMB when zooming or nudging viewport but when "emulate 3 Button Mouse" is checked it nukes the ability to employ the ALT key for selecting edge loops/rings.

I found that Left Double Click works although selection is limited and does not do half of what is available as far as selecting/deselecting goes... Hmmm?

Sorry for long scenario here, not sure if there is a workaround. It's be nice though.

Blender's keymap requires an operator to execute when the shortcut is pressed. Currently there is no operator to toggle the Emulate 3 Button Mouse option from the preferences, but this can be solved by writing a little add-on.

The following add-on creates an operator that allows to toggle the preference option and can therefore be added as a shortcut into your keymap. Copy & paste the script into a file and save it with the .py file extension.

bl_info = {
"name": "Toggle 'Emulate 3 Button Mouse'",
"author": "Robert Guetzkow",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "Edit > Operator Search",
"description": "Operator for toggeling the 'Emulate 3 Button Mouse' option.",
"warning": "",
"wiki_url": "",
"category": "Preferences"}

import bpy

class PREFERENCES_OT_toggle_emulate_3_button_mouse(bpy.types.Operator):
bl_idname = "preferences.toggle_emulate_3_button_mouse"
bl_label = "Toggle 'Emulate 3 Button Mouse'"

def execute(self, context):
context.preferences.inputs.use_mouse_emulate_3_button = not context.preferences.inputs.use_mouse_emulate_3_button
return {"FINISHED"}

classes = (PREFERENCES_OT_toggle_emulate_3_button_mouse,)

def register():
for cls in classes:
bpy.utils.register_class(cls)

def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)

if __name__ == "__main__":
register()


• Yes, you need to copy & paste the code into a file and save it with .py extension, for example toggle_emulate_3_mouse_button.py. In the preferences in the Add-ons section there is an Install button at the top. Click it and select the file. – Robert Gützkow Oct 15 at 15:17