Changeset View
Changeset View
Standalone View
Standalone View
tests/python/bl_run_operators_event_simulate.py
| Show First 20 Lines • Show All 275 Lines • ▼ Show 20 Lines | def menu(text, *, only_validate=False): | ||||
| if only_validate: | if only_validate: | ||||
| return | return | ||||
| yield dict(type='F3', value='TAP') | yield dict(type='F3', value='TAP') | ||||
| yield from gen_events_type_text(text) | yield from gen_events_type_text(text) | ||||
| yield dict(type='RET', value='TAP') | yield dict(type='RET', value='TAP') | ||||
| @staticmethod | @staticmethod | ||||
| def event(*, value, type, ctrl=False, alt=False, shift=False, repeat=1, only_validate=False): | def event(*, type, value, ctrl=False, alt=False, shift=False, repeat=1, only_validate=False): | ||||
| """ | """ | ||||
| value: The event, typically key, e.g. 'ESC', 'RET', 'SPACE', 'A'. | type: The event, typically key, e.g. 'ESC', 'RET', 'SPACE', 'A'. | ||||
| type: The event type, valid values include: 'PRESS', 'RELEASE', 'TAP'. | value: The event type, valid values include: 'PRESS', 'RELEASE', 'TAP'. | ||||
| ctrl: Control modifier. | ctrl: Control modifier. | ||||
| alt: Alt modifier. | alt: Alt modifier. | ||||
| shift: Shift modifier. | shift: Shift modifier. | ||||
| """ | """ | ||||
| valid_items = EVENT_VALUES_EXTRA | valid_items = EVENT_VALUES_EXTRA | ||||
| if value not in valid_items: | if value not in valid_items: | ||||
| raise ArgumentTypeError("'value' argument %r not in %r" % (value, valid_items)) | raise ArgumentTypeError("'value' argument %r not in %r" % (value, valid_items)) | ||||
| valid_items = EVENT_TYPES | valid_items = EVENT_TYPES | ||||
| ▲ Show 20 Lines • Show All 333 Lines • Show Last 20 Lines | |||||