init
This commit is contained in:
150
addons/godot-xr-tools/objects/keyboard/virtual_key.gd
Normal file
150
addons/godot-xr-tools/objects/keyboard/virtual_key.gd
Normal file
@@ -0,0 +1,150 @@
|
||||
@tool
|
||||
class_name XRToolsVirtualKey
|
||||
extends Node2D
|
||||
|
||||
|
||||
## Key pressed event
|
||||
signal pressed
|
||||
|
||||
## Key released event
|
||||
signal released
|
||||
|
||||
|
||||
## Key location
|
||||
@export var key_size := Vector2(32, 32) : set = _set_key_size
|
||||
|
||||
## Key text
|
||||
@export var key_text := "" : set = _set_key_text
|
||||
|
||||
## Key normal color
|
||||
@export var key_normal := Color(0.1, 0.1, 0.1) : set = _set_key_normal
|
||||
|
||||
## Key highlight color
|
||||
@export var key_highlight := Color(0.2, 0.2, 0.2) : set = _set_key_highlight
|
||||
|
||||
## Text normal color
|
||||
@export var text_normal := Color(1.0, 1.0, 1.0) : set = _set_text_normal
|
||||
|
||||
## Text highlight color
|
||||
@export var text_highlight := Color(0.0, 0.0, 0.0) : set = _set_text_highlight
|
||||
|
||||
## Key highlighted
|
||||
@export var highlighted := false : set = _set_highlighted
|
||||
|
||||
|
||||
# TouchScreenButton node
|
||||
var _button : TouchScreenButton
|
||||
|
||||
# ColorRect node
|
||||
var _color : ColorRect
|
||||
|
||||
# Label node
|
||||
var _label : Label
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
# Construct the ColorRect node
|
||||
_color = ColorRect.new()
|
||||
|
||||
# Construct the Label node
|
||||
_label = Label.new()
|
||||
_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
_label.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||
|
||||
# Construct the TouchScreenButton node
|
||||
_button = TouchScreenButton.new()
|
||||
_button.shape = RectangleShape2D.new()
|
||||
|
||||
# Attach the nodes
|
||||
_color.add_child(_label)
|
||||
_button.add_child(_color)
|
||||
add_child(_button)
|
||||
|
||||
# Handle button presses
|
||||
_button.pressed.connect(_on_button_pressed)
|
||||
_button.released.connect(_on_button_released)
|
||||
|
||||
# Apply initial updates
|
||||
_update_key_size()
|
||||
_update_key_text()
|
||||
_update_highlighted()
|
||||
|
||||
|
||||
func _on_button_pressed() -> void:
|
||||
pressed.emit()
|
||||
|
||||
|
||||
func _on_button_released() -> void:
|
||||
released.emit()
|
||||
|
||||
|
||||
func _set_key_size(p_key_size : Vector2) -> void:
|
||||
key_size = p_key_size
|
||||
if is_inside_tree():
|
||||
_update_key_size()
|
||||
|
||||
|
||||
func _set_key_text(p_key_text : String) -> void:
|
||||
key_text = p_key_text
|
||||
if is_inside_tree():
|
||||
_update_key_text()
|
||||
|
||||
|
||||
func _set_key_normal(p_key_normal : Color) -> void:
|
||||
key_normal = p_key_normal
|
||||
if is_inside_tree():
|
||||
_update_highlighted()
|
||||
|
||||
|
||||
func _set_key_highlight(p_key_highlight : Color) -> void:
|
||||
key_highlight = p_key_highlight
|
||||
if is_inside_tree():
|
||||
_update_highlighted()
|
||||
|
||||
|
||||
func _set_text_normal(p_text_normal : Color) -> void:
|
||||
text_normal = p_text_normal
|
||||
if is_inside_tree():
|
||||
_update_highlighted()
|
||||
|
||||
|
||||
func _set_text_highlight(p_text_highlight : Color) -> void:
|
||||
text_highlight = p_text_highlight
|
||||
if is_inside_tree():
|
||||
_update_highlighted()
|
||||
|
||||
|
||||
func _set_highlighted(p_highlighted : bool) -> void:
|
||||
highlighted = p_highlighted
|
||||
if is_inside_tree():
|
||||
_update_highlighted()
|
||||
|
||||
|
||||
func _update_key_size() -> void:
|
||||
var half_size := key_size / 2
|
||||
|
||||
# Set the TouchScreenButton position and shape size
|
||||
_button.position = half_size
|
||||
_button.shape.size = key_size
|
||||
|
||||
# Size and position the ColorRect
|
||||
_color.size = key_size
|
||||
_color.position = -half_size
|
||||
|
||||
# Size the label
|
||||
_label.size = key_size
|
||||
|
||||
|
||||
func _update_key_text() -> void:
|
||||
_label.text = key_text
|
||||
|
||||
|
||||
func _update_highlighted() -> void:
|
||||
# Pick colors
|
||||
var key := key_highlight if highlighted else key_normal
|
||||
var text := text_highlight if highlighted else text_normal
|
||||
|
||||
# Set colors
|
||||
_color.color = key
|
||||
_label.add_theme_color_override("font_color", text)
|
||||
@@ -0,0 +1 @@
|
||||
uid://bk7d6s38ejigt
|
||||
45
addons/godot-xr-tools/objects/keyboard/virtual_key_char.gd
Normal file
45
addons/godot-xr-tools/objects/keyboard/virtual_key_char.gd
Normal file
@@ -0,0 +1,45 @@
|
||||
@tool
|
||||
class_name XRToolsVirtualKeyChar
|
||||
extends XRToolsVirtualKey
|
||||
|
||||
|
||||
## Godot scan-code text
|
||||
@export var scan_code_text := ""
|
||||
|
||||
## Unicode character
|
||||
@export var unicode := 0
|
||||
|
||||
## Shift modifier
|
||||
@export var shift_modifier := false
|
||||
|
||||
|
||||
# Keyboard associated with this button
|
||||
var _keyboard : XRToolsVirtualKeyboard2D
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
# Call the base
|
||||
super()
|
||||
|
||||
# Find the keyboard
|
||||
_keyboard = XRTools.find_xr_ancestor(
|
||||
self,
|
||||
"*",
|
||||
"XRToolsVirtualKeyboard2D")
|
||||
|
||||
# Handle button presses
|
||||
pressed.connect(_on_pressed)
|
||||
released.connect(_on_released)
|
||||
|
||||
|
||||
# Handler for button pressed
|
||||
func _on_pressed() -> void:
|
||||
highlighted = true
|
||||
if _keyboard:
|
||||
_keyboard.on_key_pressed(scan_code_text, unicode, shift_modifier)
|
||||
|
||||
|
||||
# Handler for button released
|
||||
func _on_released() -> void:
|
||||
highlighted = false
|
||||
@@ -0,0 +1 @@
|
||||
uid://tae1jc8su0i6
|
||||
102
addons/godot-xr-tools/objects/keyboard/virtual_keyboard_2d.gd
Normal file
102
addons/godot-xr-tools/objects/keyboard/virtual_keyboard_2d.gd
Normal file
@@ -0,0 +1,102 @@
|
||||
@tool
|
||||
class_name XRToolsVirtualKeyboard2D
|
||||
extends CanvasLayer
|
||||
|
||||
|
||||
## Enumeration of keyboard view modes
|
||||
enum KeyboardMode {
|
||||
LOWER_CASE, ## Lower-case keys mode
|
||||
UPPER_CASE, ## Upper-case keys mode
|
||||
ALTERNATE ## Alternate keys mode
|
||||
}
|
||||
|
||||
|
||||
# Shift button down
|
||||
var _shift_down := false
|
||||
|
||||
# Caps button down
|
||||
var _caps_down := false
|
||||
|
||||
# Alt button down
|
||||
var _alt_down := false
|
||||
|
||||
# Current keyboard mode
|
||||
var _mode: int = KeyboardMode.LOWER_CASE
|
||||
|
||||
|
||||
# Add support for is_xr_class on XRTools classes
|
||||
func is_xr_class(xr_name: String) -> bool:
|
||||
return xr_name == "XRToolsVirtualKeyboard2D"
|
||||
|
||||
|
||||
# Handle key pressed from VirtualKey
|
||||
func on_key_pressed(scan_code_text: String, unicode: int, shift: bool):
|
||||
# Find the scan code
|
||||
var scan_code := OS.find_keycode_from_string(scan_code_text)
|
||||
|
||||
# Create the InputEventKey
|
||||
var input := InputEventKey.new()
|
||||
input.physical_keycode = scan_code
|
||||
input.unicode = unicode if unicode else scan_code
|
||||
input.pressed = true
|
||||
input.keycode = scan_code
|
||||
input.shift_pressed = shift
|
||||
|
||||
# Dispatch the input event
|
||||
Input.parse_input_event(input)
|
||||
|
||||
# Pop any temporary shift key
|
||||
if _shift_down:
|
||||
_shift_down = false
|
||||
_update_visible()
|
||||
|
||||
|
||||
func _on_toggle_shift_pressed() -> void:
|
||||
# Update toggle keys
|
||||
_shift_down = not _shift_down
|
||||
_caps_down = false
|
||||
_alt_down = false
|
||||
_update_visible()
|
||||
|
||||
|
||||
func _on_toggle_caps_pressed() -> void:
|
||||
# Update toggle keys
|
||||
_caps_down = not _caps_down
|
||||
_shift_down = false
|
||||
_alt_down = false
|
||||
_update_visible()
|
||||
|
||||
|
||||
func _on_toggle_alt_pressed() -> void:
|
||||
# Update toggle keys
|
||||
_alt_down = not _alt_down
|
||||
_shift_down = false
|
||||
_caps_down = false
|
||||
_update_visible()
|
||||
|
||||
|
||||
# Update switching the visible case keys
|
||||
func _update_visible() -> void:
|
||||
# Ensure the control buttons are set correctly
|
||||
$Background/Standard/ToggleShift.highlighted = _shift_down
|
||||
$Background/Standard/ToggleCaps.highlighted = _caps_down
|
||||
$Background/Standard/ToggleAlt.highlighted = _alt_down
|
||||
|
||||
# Evaluate the new mode
|
||||
var new_mode: int
|
||||
if _alt_down:
|
||||
new_mode = KeyboardMode.ALTERNATE
|
||||
elif _shift_down or _caps_down:
|
||||
new_mode = KeyboardMode.UPPER_CASE
|
||||
else:
|
||||
new_mode = KeyboardMode.LOWER_CASE
|
||||
|
||||
# Skip if no change
|
||||
if new_mode == _mode:
|
||||
return
|
||||
|
||||
# Update the visible mode
|
||||
_mode = new_mode
|
||||
$Background/LowerCase.visible = _mode == KeyboardMode.LOWER_CASE
|
||||
$Background/UpperCase.visible = _mode == KeyboardMode.UPPER_CASE
|
||||
$Background/Alternate.visible = _mode == KeyboardMode.ALTERNATE
|
||||
@@ -0,0 +1 @@
|
||||
uid://phmvrwkudp7u
|
||||
724
addons/godot-xr-tools/objects/keyboard/virtual_keyboard_2d.tscn
Normal file
724
addons/godot-xr-tools/objects/keyboard/virtual_keyboard_2d.tscn
Normal file
@@ -0,0 +1,724 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://lauwp8okd1vh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://phmvrwkudp7u" path="res://addons/godot-xr-tools/objects/keyboard/virtual_keyboard_2d.gd" id="1"]
|
||||
[ext_resource type="Script" uid="uid://tae1jc8su0i6" path="res://addons/godot-xr-tools/objects/keyboard/virtual_key_char.gd" id="2_n0nlg"]
|
||||
[ext_resource type="Script" uid="uid://bk7d6s38ejigt" path="res://addons/godot-xr-tools/objects/keyboard/virtual_key.gd" id="3_h05ve"]
|
||||
|
||||
[node name="VirtualKeyboard2D" type="CanvasLayer"]
|
||||
script = ExtResource("1")
|
||||
|
||||
[node name="Background" type="ColorRect" parent="."]
|
||||
offset_right = 400.0
|
||||
offset_bottom = 200.0
|
||||
color = Color(0.12549, 0.12549, 0.12549, 0.752941)
|
||||
|
||||
[node name="Standard" type="Control" parent="Background"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 0
|
||||
offset_left = 4.0
|
||||
offset_top = 4.0
|
||||
offset_right = 394.0
|
||||
offset_bottom = 149.0
|
||||
|
||||
[node name="VirtualKey1" type="Node2D" parent="Background/Standard"]
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "1"
|
||||
unicode = 49
|
||||
key_text = "1"
|
||||
|
||||
[node name="VirtualKey2" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(40, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "2"
|
||||
unicode = 50
|
||||
key_text = "2"
|
||||
|
||||
[node name="VirtualKey3" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(80, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "3"
|
||||
unicode = 51
|
||||
key_text = "3"
|
||||
|
||||
[node name="VirtualKey4" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(120, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "4"
|
||||
unicode = 52
|
||||
key_text = "4"
|
||||
|
||||
[node name="VirtualKey5" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(160, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "5"
|
||||
unicode = 53
|
||||
key_text = "5"
|
||||
|
||||
[node name="VirtualKey6" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(200, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "6"
|
||||
unicode = 54
|
||||
key_text = "6"
|
||||
|
||||
[node name="VirtualKey7" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(240, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "7"
|
||||
unicode = 55
|
||||
key_text = "7"
|
||||
|
||||
[node name="VirtualKey8" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(280, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "8"
|
||||
unicode = 56
|
||||
key_text = "8"
|
||||
|
||||
[node name="VirtualKey9" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(320, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "9"
|
||||
unicode = 57
|
||||
key_text = "9"
|
||||
|
||||
[node name="VirtualKey0" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(360, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "0"
|
||||
unicode = 48
|
||||
key_text = "0"
|
||||
|
||||
[node name="ToggleShift" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(0, 120)
|
||||
script = ExtResource("3_h05ve")
|
||||
key_size = Vector2(50, 32)
|
||||
key_text = "SHIFT"
|
||||
key_highlight = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="ToggleCaps" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(0, 160)
|
||||
script = ExtResource("3_h05ve")
|
||||
key_size = Vector2(45, 32)
|
||||
key_text = "CAPS"
|
||||
key_highlight = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="ToggleAlt" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(55, 160)
|
||||
script = ExtResource("3_h05ve")
|
||||
key_size = Vector2(35, 32)
|
||||
key_text = "ALT"
|
||||
key_highlight = Color(1, 1, 1, 1)
|
||||
|
||||
[node name="VirtualKeyBackspace" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(340, 120)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "BackSpace"
|
||||
key_size = Vector2(52, 32)
|
||||
key_text = "BKSP"
|
||||
|
||||
[node name="VirtualKeySpace" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(100, 160)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Space"
|
||||
unicode = 32
|
||||
key_size = Vector2(190, 32)
|
||||
key_text = "Space"
|
||||
|
||||
[node name="VirtualKeyPeriod" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(300, 160)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Period"
|
||||
unicode = 46
|
||||
key_text = "."
|
||||
|
||||
[node name="VirtualKeyEnter" type="Node2D" parent="Background/Standard"]
|
||||
position = Vector2(340, 160)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Enter"
|
||||
key_size = Vector2(52, 32)
|
||||
key_text = "Enter"
|
||||
|
||||
[node name="LowerCase" type="Node2D" parent="Background"]
|
||||
position = Vector2(4, 44)
|
||||
|
||||
[node name="VirtualKeyLowerQ" type="Node2D" parent="Background/LowerCase"]
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Q"
|
||||
unicode = 113
|
||||
key_text = "q"
|
||||
|
||||
[node name="VirtualKeyLowerW" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(40, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "W"
|
||||
unicode = 119
|
||||
key_text = "w"
|
||||
|
||||
[node name="VirtualKeyLowerE" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(80, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "E"
|
||||
unicode = 101
|
||||
key_text = "e"
|
||||
|
||||
[node name="VirtualKeyLowerR" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(120, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "R"
|
||||
unicode = 114
|
||||
key_text = "r"
|
||||
|
||||
[node name="VirtualKeyLowerT" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(160, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "T"
|
||||
unicode = 116
|
||||
key_text = "t"
|
||||
|
||||
[node name="VirtualKeyLowerY" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(200, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Y"
|
||||
unicode = 121
|
||||
key_text = "y"
|
||||
|
||||
[node name="VirtualKeyLowerU" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(240, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "U"
|
||||
unicode = 117
|
||||
key_text = "u"
|
||||
|
||||
[node name="VirtualKeyLowerI" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(280, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "I"
|
||||
unicode = 105
|
||||
key_text = "i"
|
||||
|
||||
[node name="VirtualKeyLowerO" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(320, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "O"
|
||||
unicode = 111
|
||||
key_text = "o"
|
||||
|
||||
[node name="VirtualKeyLowerP" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(360, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "P"
|
||||
unicode = 112
|
||||
key_text = "p"
|
||||
|
||||
[node name="VirtualKeyLowerA" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(20, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "A"
|
||||
unicode = 97
|
||||
key_text = "a"
|
||||
|
||||
[node name="VirtualKeyLowerS" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(60, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "S"
|
||||
unicode = 115
|
||||
key_text = "s"
|
||||
|
||||
[node name="VirtualKeyLowerD" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(100, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "D"
|
||||
unicode = 100
|
||||
key_text = "d"
|
||||
|
||||
[node name="VirtualKeyLowerF" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(140, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "F"
|
||||
unicode = 102
|
||||
key_text = "f"
|
||||
|
||||
[node name="VirtualKeyLowerG" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(180, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "G"
|
||||
unicode = 103
|
||||
key_text = "g"
|
||||
|
||||
[node name="VirtualKeyLowerH" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(220, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "H"
|
||||
unicode = 104
|
||||
key_text = "h"
|
||||
|
||||
[node name="VirtualKeyLowerJ" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(260, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "J"
|
||||
unicode = 106
|
||||
key_text = "j"
|
||||
|
||||
[node name="VirtualKeyLowerK" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(300, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "K"
|
||||
unicode = 107
|
||||
key_text = "k"
|
||||
|
||||
[node name="VirtualKeyLowerL" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(340, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "L"
|
||||
unicode = 108
|
||||
key_text = "l"
|
||||
|
||||
[node name="VirtualKeyLowerZ" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(60, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Z"
|
||||
unicode = 122
|
||||
key_text = "z"
|
||||
|
||||
[node name="VirtualKeyLowerX" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(100, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "X"
|
||||
unicode = 120
|
||||
key_text = "x"
|
||||
|
||||
[node name="VirtualKeyLowerC" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(140, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "C"
|
||||
unicode = 99
|
||||
key_text = "c"
|
||||
|
||||
[node name="VirtualKeyLowerV" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(180, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "V"
|
||||
unicode = 118
|
||||
key_text = "v"
|
||||
|
||||
[node name="VirtualKeyLowerB" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(220, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "B"
|
||||
unicode = 98
|
||||
key_text = "b"
|
||||
|
||||
[node name="VirtualKeyLowerN" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(260, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "N"
|
||||
unicode = 110
|
||||
key_text = "n"
|
||||
|
||||
[node name="VirtualKeyLowerM" type="Node2D" parent="Background/LowerCase"]
|
||||
position = Vector2(300, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "M"
|
||||
unicode = 109
|
||||
key_text = "m"
|
||||
|
||||
[node name="UpperCase" type="Node2D" parent="Background"]
|
||||
visible = false
|
||||
position = Vector2(4, 44)
|
||||
|
||||
[node name="VirtualKeyUpperQ" type="Node2D" parent="Background/UpperCase"]
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Q"
|
||||
unicode = 81
|
||||
shift_modifier = true
|
||||
key_text = "Q"
|
||||
|
||||
[node name="VirtualKeyUpperW" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(40, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "W"
|
||||
unicode = 87
|
||||
shift_modifier = true
|
||||
key_text = "W"
|
||||
|
||||
[node name="VirtualKeyUpperE" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(80, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "E"
|
||||
unicode = 69
|
||||
shift_modifier = true
|
||||
key_text = "E"
|
||||
|
||||
[node name="VirtualKeyUpperR" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(120, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "R"
|
||||
unicode = 82
|
||||
shift_modifier = true
|
||||
key_text = "R"
|
||||
|
||||
[node name="VirtualKeyUpperT" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(160, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "T"
|
||||
unicode = 84
|
||||
shift_modifier = true
|
||||
key_text = "T"
|
||||
|
||||
[node name="VirtualKeyUpperY" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(200, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Y"
|
||||
unicode = 89
|
||||
shift_modifier = true
|
||||
key_text = "Y"
|
||||
|
||||
[node name="VirtualKeyUpperU" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(240, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "U"
|
||||
unicode = 85
|
||||
shift_modifier = true
|
||||
key_text = "U"
|
||||
|
||||
[node name="VirtualKeyUpperI" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(280, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "I"
|
||||
unicode = 73
|
||||
shift_modifier = true
|
||||
key_text = "I"
|
||||
|
||||
[node name="VirtualKeyUpperO" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(320, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "O"
|
||||
unicode = 79
|
||||
shift_modifier = true
|
||||
key_text = "O"
|
||||
|
||||
[node name="VirtualKeyUpperP" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(360, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "P"
|
||||
unicode = 80
|
||||
shift_modifier = true
|
||||
key_text = "P"
|
||||
|
||||
[node name="VirtualKeyUpperA" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(20, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "A"
|
||||
unicode = 65
|
||||
shift_modifier = true
|
||||
key_text = "A"
|
||||
|
||||
[node name="VirtualKeyUpperS" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(60, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "S"
|
||||
unicode = 83
|
||||
shift_modifier = true
|
||||
key_text = "S"
|
||||
|
||||
[node name="VirtualKeyUpperD" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(100, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "D"
|
||||
unicode = 68
|
||||
shift_modifier = true
|
||||
key_text = "D"
|
||||
|
||||
[node name="VirtualKeyUpperF" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(140, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "F"
|
||||
unicode = 70
|
||||
shift_modifier = true
|
||||
key_text = "F"
|
||||
|
||||
[node name="VirtualKeyUpperG" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(180, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "G"
|
||||
unicode = 71
|
||||
shift_modifier = true
|
||||
key_text = "G"
|
||||
|
||||
[node name="VirtualKeyUpperH" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(220, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "H"
|
||||
unicode = 72
|
||||
shift_modifier = true
|
||||
key_text = "H"
|
||||
|
||||
[node name="VirtualKeyUpperJ" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(260, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "J"
|
||||
unicode = 74
|
||||
shift_modifier = true
|
||||
key_text = "J"
|
||||
|
||||
[node name="VirtualKeyUpperK" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(300, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "K"
|
||||
unicode = 75
|
||||
shift_modifier = true
|
||||
key_text = "K"
|
||||
|
||||
[node name="VirtualKeyUpperL" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(340, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "L"
|
||||
unicode = 76
|
||||
shift_modifier = true
|
||||
key_text = "L"
|
||||
|
||||
[node name="VirtualKeyUpperZ" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(60, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Z"
|
||||
unicode = 90
|
||||
shift_modifier = true
|
||||
key_text = "Z"
|
||||
|
||||
[node name="VirtualKeyUpperX" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(100, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "X"
|
||||
unicode = 88
|
||||
shift_modifier = true
|
||||
key_text = "X"
|
||||
|
||||
[node name="VirtualKeyUpperC" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(140, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "C"
|
||||
unicode = 67
|
||||
shift_modifier = true
|
||||
key_text = "C"
|
||||
|
||||
[node name="VirtualKeyUpperV" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(180, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "V"
|
||||
unicode = 86
|
||||
shift_modifier = true
|
||||
key_text = "V"
|
||||
|
||||
[node name="VirtualKeyUpperB" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(220, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "B"
|
||||
unicode = 66
|
||||
shift_modifier = true
|
||||
key_text = "B"
|
||||
|
||||
[node name="VirtualKeyUpperN" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(260, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "N"
|
||||
unicode = 78
|
||||
shift_modifier = true
|
||||
key_text = "N"
|
||||
|
||||
[node name="VirtualKeyUpperM" type="Node2D" parent="Background/UpperCase"]
|
||||
position = Vector2(300, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "M"
|
||||
unicode = 77
|
||||
shift_modifier = true
|
||||
key_text = "M"
|
||||
|
||||
[node name="Alternate" type="Node2D" parent="Background"]
|
||||
visible = false
|
||||
position = Vector2(4, 44)
|
||||
|
||||
[node name="VirtualKeyPlus" type="Node2D" parent="Background/Alternate"]
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Plus"
|
||||
unicode = 43
|
||||
key_text = "+"
|
||||
|
||||
[node name="VirtualKeyAsterisk" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(40, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Asterisk"
|
||||
unicode = 42
|
||||
key_text = "*"
|
||||
|
||||
[node name="VirtualKeyDivision" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(80, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Division"
|
||||
unicode = 247
|
||||
key_text = "÷"
|
||||
|
||||
[node name="VirtualKeyEqual" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(120, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Equal"
|
||||
unicode = 61
|
||||
key_text = "="
|
||||
|
||||
[node name="VirtualKeySlash" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(160, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Slash"
|
||||
unicode = 47
|
||||
key_text = "/"
|
||||
|
||||
[node name="VirtualKeyUnderScore" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(200, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "UnderScore"
|
||||
unicode = 95
|
||||
key_text = "_"
|
||||
|
||||
[node name="VirtualKeyLess" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(240, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Less"
|
||||
unicode = 60
|
||||
key_text = "<"
|
||||
|
||||
[node name="VirtualKeyGreater" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(280, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Greater"
|
||||
unicode = 62
|
||||
key_text = ">"
|
||||
|
||||
[node name="VirtualKeyBracketLeft" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(320, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "BracketLeft"
|
||||
unicode = 91
|
||||
key_text = "["
|
||||
|
||||
[node name="VirtualKeyBracketRight" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(360, 0)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "BracketRight"
|
||||
unicode = 93
|
||||
key_text = "]"
|
||||
|
||||
[node name="VirtualKeyExclam" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(20, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Exclam"
|
||||
unicode = 33
|
||||
key_text = "!"
|
||||
|
||||
[node name="VirtualKeyAt" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(60, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "At"
|
||||
unicode = 64
|
||||
key_text = "@"
|
||||
|
||||
[node name="VirtualKeyNumberSign" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(100, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "NumberSign"
|
||||
unicode = 35
|
||||
key_text = "#"
|
||||
|
||||
[node name="VirtualKeyDollar" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(140, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Dollar"
|
||||
unicode = 36
|
||||
key_text = "$"
|
||||
|
||||
[node name="VirtualKeyPercent" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(180, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Percent"
|
||||
unicode = 37
|
||||
key_text = "%"
|
||||
|
||||
[node name="VirtualKeyCircumflex" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(220, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "AsciiCircum"
|
||||
unicode = 94
|
||||
key_text = "^"
|
||||
|
||||
[node name="VirtualKeyAmpersand" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(260, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Ampersand"
|
||||
unicode = 38
|
||||
key_text = "&"
|
||||
|
||||
[node name="VirtualKeyParenLeft" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(300, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "ParenLeft"
|
||||
unicode = 40
|
||||
key_text = "("
|
||||
|
||||
[node name="VirtualKeyParenRight" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(340, 40)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "ParenRight"
|
||||
unicode = 41
|
||||
key_text = ")"
|
||||
|
||||
[node name="VirtualKeyMinus" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(60, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Minus"
|
||||
unicode = 45
|
||||
key_text = "-"
|
||||
|
||||
[node name="VirtualKeyApostrophe" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(100, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Apostrophe"
|
||||
unicode = 39
|
||||
key_text = "'"
|
||||
|
||||
[node name="VirtualKeyQuoteDbl" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(140, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "QuoteDbl"
|
||||
unicode = 34
|
||||
key_text = "\""
|
||||
|
||||
[node name="VirtualKeyColon" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(180, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Colon"
|
||||
unicode = 58
|
||||
key_text = ":"
|
||||
|
||||
[node name="VirtualKeySemicolon" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(220, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Semicolon"
|
||||
unicode = 59
|
||||
key_text = ";"
|
||||
|
||||
[node name="VirtualKeyComma" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(260, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Comma"
|
||||
unicode = 44
|
||||
key_text = ","
|
||||
|
||||
[node name="VirtualKeyQuestion" type="Node2D" parent="Background/Alternate"]
|
||||
position = Vector2(300, 80)
|
||||
script = ExtResource("2_n0nlg")
|
||||
scan_code_text = "Question"
|
||||
unicode = 63
|
||||
key_text = "?"
|
||||
|
||||
[connection signal="pressed" from="Background/Standard/ToggleShift" to="." method="_on_toggle_shift_pressed"]
|
||||
[connection signal="pressed" from="Background/Standard/ToggleCaps" to="." method="_on_toggle_caps_pressed"]
|
||||
[connection signal="pressed" from="Background/Standard/ToggleAlt" to="." method="_on_toggle_alt_pressed"]
|
||||
Reference in New Issue
Block a user