2017-04-10 21:17:17 +02:00
|
|
|
from arm.logicnode.arm_nodes import *
|
|
|
|
|
2020-09-08 21:16:20 +02:00
|
|
|
class KeyboardNode(ArmLogicTreeNode):
|
2020-10-05 19:55:56 +02:00
|
|
|
"""Activates the output when the given keyboard action is done."""
|
2019-04-30 17:07:57 +02:00
|
|
|
bl_idname = 'LNMergedKeyboardNode'
|
2019-01-27 21:56:38 +01:00
|
|
|
bl_label = 'Keyboard'
|
2020-10-27 19:44:37 +01:00
|
|
|
arm_section = 'keyboard'
|
2020-09-13 11:27:58 +02:00
|
|
|
arm_version = 1
|
2019-11-04 21:35:18 +01: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-27 17:17:11 +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(KeyboardNode, self).init(context)
|
2020-09-08 21:49:02 +02:00
|
|
|
self.add_output('ArmNodeSocketAction', 'Out')
|
|
|
|
self.add_output('NodeSocketBool', 'State')
|
2017-04-10 21:17:17 +02:00
|
|
|
|
|
|
|
def draw_buttons(self, context, layout):
|
|
|
|
layout.prop(self, 'property0')
|
|
|
|
layout.prop(self, 'property1')
|
|
|
|
|