2017-04-10 21:17:17 +02:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class OnKeyboardNode(ArmLogicTreeNode):
|
2020-09-08 23:14:51 +02:00
|
|
|
"""On keyboard node"""
|
2017-04-10 21:17:17 +02:00
|
|
|
bl_idname = 'LNOnKeyboardNode'
|
|
|
|
bl_label = 'On Keyboard'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2017-04-10 21:17:17 +02:00
|
|
|
|
2018-12-18 23:48:38 +01:00
|
|
|
property0: EnumProperty(
|
2017-04-10 21:17:17 +02:00
|
|
|
items = [('Down', 'Down', 'Down'),
|
|
|
|
('Started', 'Started', 'Started'),
|
|
|
|
('Released', 'Released', 'Released')],
|
|
|
|
name='', default='Started')
|
2019-11-04 21:35:18 +01:00
|
|
|
|
2018-12-18 23:48:38 +01:00
|
|
|
property1: EnumProperty(
|
2017-04-10 21:17:17 +02:00
|
|
|
items = [('a', 'a', 'a'),
|
|
|
|
('b', 'b', 'b'),
|
|
|
|
('c', 'c', 'c'),
|
|
|
|
('d', 'd', 'd'),
|
|
|
|
('e', 'e', 'e'),
|
|
|
|
('f', 'f', 'f'),
|
|
|
|
('g', 'g', 'g'),
|
|
|
|
('h', 'h', 'h'),
|
|
|
|
('i', 'i', 'i'),
|
|
|
|
('j', 'j', 'j'),
|
|
|
|
('k', 'k', 'k'),
|
|
|
|
('l', 'l', 'l'),
|
|
|
|
('m', 'm', 'm'),
|
|
|
|
('n', 'n', 'n'),
|
|
|
|
('o', 'o', 'o'),
|
|
|
|
('p', 'p', 'p'),
|
|
|
|
('q', 'q', 'q'),
|
|
|
|
('r', 'r', 'r'),
|
|
|
|
('s', 's', 's'),
|
|
|
|
('t', 't', 't'),
|
|
|
|
('u', 'u', 'u'),
|
|
|
|
('v', 'v', 'v'),
|
|
|
|
('w', 'w', 'w'),
|
|
|
|
('x', 'x', 'x'),
|
|
|
|
('y', 'y', 'y'),
|
|
|
|
('z', 'z', 'z'),
|
|
|
|
('0', '0', '0'),
|
|
|
|
('1', '1', '1'),
|
|
|
|
('2', '2', '2'),
|
|
|
|
('3', '3', '3'),
|
|
|
|
('4', '4', '4'),
|
|
|
|
('5', '5', '5'),
|
|
|
|
('6', '6', '6'),
|
|
|
|
('7', '7', '7'),
|
|
|
|
('8', '8', '8'),
|
|
|
|
('9', '9', '9'),
|
2019-11-04 21:35:18 +01:00
|
|
|
('.', 'period', 'period'),
|
|
|
|
(',', 'comma', 'comma'),
|
2017-04-10 21:17:17 +02:00
|
|
|
('space', 'space', 'space'),
|
|
|
|
('backspace', 'backspace', 'backspace'),
|
|
|
|
('tab', 'tab', 'tab'),
|
2019-06-29 09:05:44 +02:00
|
|
|
('enter', 'enter', 'enter'),
|
2017-04-10 21:17:17 +02:00
|
|
|
('shift', 'shift', 'shift'),
|
2017-06-08 02:10:40 +02:00
|
|
|
('control', 'control', 'control'),
|
2017-04-10 21:17:17 +02:00
|
|
|
('alt', 'alt', 'alt'),
|
2017-06-08 02:10:40 +02:00
|
|
|
('escape', 'escape', 'escape'),
|
|
|
|
('delete', 'delete', 'delete'),
|
2017-04-10 21:17:17 +02:00
|
|
|
('back', 'back', 'back'),
|
|
|
|
('up', 'up', 'up'),
|
|
|
|
('right', 'right', 'right'),
|
|
|
|
('left', 'left', 'left'),
|
|
|
|
('down', 'down', 'down'),],
|
|
|
|
name='', default='space')
|
|
|
|
|
|
|
|
def init(self, context):
|
2020-09-13 11:27:58 +02:00
|
|
|
super(OnKeyboardNode, self).init(context)
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|
2017-04-10 21:17:17 +02:00
|
|
|
|
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|
|
|
|
layout.prop(self, 'property1')
|
|
|
|
|
2020-09-09 20:48:35 +02:00
|
|
|
add_node(OnKeyboardNode, category=PKG_AS_CATEGORY, section='keyboard')
|