can someone give a link for the key names for pie menu keys
like TAB PERIOD ect
I cannot find what name I should use for some keys like backslash and what about special function F1 to F12 or others !
Because there are no small letters, there are only keyboard letter keys with or without shift-key modifier. If you are interested in what was intended to be typed by the user, use the .ascii or .unicode attribute instead.
EVT_TWEAK_L:
As the name suggests, it is a tweak event, or in other words hack / workaround. Probably related to mouse gestures (a mouse button press needs to be distinguished from a press-and-drag).
TIMER is only used internally as far as I know and probably not working if used with Python.
Special (media) keys are not recognized by Blender.
Ascii / Unicode example:
import bpy
from bpy.props import IntProperty, FloatProperty
class ModalOperator(bpy.types.Operator):
"""Move an object with the mouse, example"""
bl_idname = "object.modal_operator"
bl_label = "Simple Modal Operator"
def modal(self, context, event):
mod_keys = []
for k in ['ctrl', 'shift', 'alt', 'oskey']:
if getattr(event, k):
mod_keys.append(k.title())
context.area.header_text_set("Ascii: %s Unicode: %s %s %s %s (%s)" % (
event.ascii, event.unicode, " + ".join(mod_keys), " + " if mod_keys else "", event.type, event.value)
)
if event.type == 'ESC':
context.area.header_text_set()
return {'CANCELLED'}
return {'RUNNING_MODAL'}
def invoke(self, context, event):
context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}
def register():
bpy.utils.register_class(ModalOperator)
def unregister():
bpy.utils.unregister_class(ModalOperator)
if __name__ == "__main__":
register()
# test call
bpy.ops.object.modal_operator('INVOKE_DEFAULT')