forked from LeenkxTeam/LNXSDK
Repe [T3DU] Update - 31f26d171bba0355ce2a77031e3aad4c64dbc7e9
This commit is contained in:
30
leenkx/blender/lnx/logicnode/input/LN_get_keyboard.py
Normal file
30
leenkx/blender/lnx/logicnode/input/LN_get_keyboard.py
Normal file
@ -0,0 +1,30 @@
|
||||
from lnx.logicnode.lnx_nodes import *
|
||||
|
||||
class GetKeyboardNode(LnxLogicTreeNode):
|
||||
bl_idname = 'LNGetKeyboardNode'
|
||||
bl_label = 'Get Keyboard'
|
||||
lnx_section = 'keyboard'
|
||||
lnx_version = 1
|
||||
|
||||
def update(self):
|
||||
self.label = f'{self.bl_label}: {self.property0}'
|
||||
|
||||
def upd(self, context):
|
||||
self.label = f'{self.bl_label}: {self.property0}'
|
||||
|
||||
property0: HaxeEnumProperty(
|
||||
'property0',
|
||||
items = [('started', 'Started', 'The keyboard button starts to be pressed'),
|
||||
('down', 'Down', 'The keyboard button is pressed'),
|
||||
('released', 'Released', 'The keyboard button stops being pressed')],
|
||||
name='', default='started', update=upd)
|
||||
|
||||
def lnx_init(self, context):
|
||||
self.add_output('LnxNodeSocketAction', 'Out')
|
||||
self.add_output('LnxStringSocket', 'Key')
|
||||
|
||||
def draw_buttons(self, context, layout):
|
||||
layout.prop(self, 'property0')
|
||||
|
||||
def draw_label(self) -> str:
|
||||
return f'{self.bl_label}: {self.property0}'
|
||||
Reference in New Issue
Block a user