Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
20c218405a | |||
dc69ce81e0 |
6 changed files with 358 additions and 153 deletions
|
@ -3,16 +3,20 @@
|
|||
name="Windows Desktop"
|
||||
platform="Windows Desktop"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=".export/release 1.4.5/steam/PNGTUBER PLUS 1.4.5 STEAM.exe"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.0.options]
|
||||
|
||||
|
@ -20,10 +24,8 @@ custom_template/debug=""
|
|||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=false
|
||||
texture_format/bptc=true
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
binary_format/architecture="x86_64"
|
||||
codesign/enable=false
|
||||
codesign/timestamp=true
|
||||
|
@ -42,6 +44,9 @@ application/product_name="PNGTuber Plus"
|
|||
application/file_description=""
|
||||
application/copyright=""
|
||||
application/trademarks=""
|
||||
application/export_angle=0
|
||||
application/export_d3d12=0
|
||||
application/d3d12_agility_sdk_multiarch=true
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
|
@ -59,33 +64,39 @@ Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorActi
|
|||
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
|
||||
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
|
||||
Remove-Item -Recurse -Force '{temp_dir}'"
|
||||
texture_format/bptc=true
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
|
||||
[preset.1]
|
||||
|
||||
name="Linux/X11"
|
||||
platform="Linux/X11"
|
||||
platform="Linux"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=".export/release 1.4.5/linux/PNGTUBER PLUS 1.4.5 LINUX.x86_64"
|
||||
export_path="../../../Desktop/PNGTUBER PLUS 1.4.5 LINUX.x86_64"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.1.options]
|
||||
|
||||
custom_template/debug=""
|
||||
custom_template/release=""
|
||||
debug/export_console_wrapper=1
|
||||
binary_format/embed_pck=false
|
||||
texture_format/bptc=true
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
binary_format/embed_pck=true
|
||||
texture_format/s3tc_bptc=true
|
||||
texture_format/etc2_astc=false
|
||||
binary_format/architecture="x86_64"
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
|
@ -99,22 +110,30 @@ unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
|
|||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
|
||||
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
|
||||
rm -rf \"{temp_dir}\""
|
||||
texture_format/bptc=true
|
||||
texture_format/s3tc=true
|
||||
texture_format/etc=false
|
||||
texture_format/etc2=false
|
||||
|
||||
[preset.2]
|
||||
|
||||
name="macOS"
|
||||
platform="macOS"
|
||||
runnable=true
|
||||
advanced_options=false
|
||||
dedicated_server=false
|
||||
custom_features=""
|
||||
export_filter="all_resources"
|
||||
include_filter=""
|
||||
exclude_filter=""
|
||||
export_path=".export/release 1.4.5/mac/PNGTUBER PLUS 1.4.5 MAC.zip"
|
||||
export_path="../../../Desktop/PNGTUBER PLUS 1.4.5 MAC.zip"
|
||||
patches=PackedStringArray()
|
||||
encryption_include_filters=""
|
||||
encryption_exclude_filters=""
|
||||
seed=0
|
||||
encrypt_pck=false
|
||||
encrypt_directory=false
|
||||
script_export_mode=2
|
||||
|
||||
[preset.2.options]
|
||||
|
||||
|
@ -132,8 +151,11 @@ application/short_version="1.4.5"
|
|||
application/version="1.4.5"
|
||||
application/copyright=""
|
||||
application/copyright_localized={}
|
||||
application/min_macos_version="10.12"
|
||||
application/min_macos_version_x86_64="10.12"
|
||||
application/min_macos_version_arm64="11.00"
|
||||
application/export_angle=0
|
||||
display/high_res=true
|
||||
application/additional_plist_content=""
|
||||
xcode/platform_build="14C18"
|
||||
xcode/sdk_version="13.1"
|
||||
xcode/sdk_build="22C55"
|
||||
|
@ -166,7 +188,9 @@ codesign/entitlements/app_sandbox/files_downloads=0
|
|||
codesign/entitlements/app_sandbox/files_pictures=0
|
||||
codesign/entitlements/app_sandbox/files_music=0
|
||||
codesign/entitlements/app_sandbox/files_movies=0
|
||||
codesign/entitlements/app_sandbox/files_user_selected=0
|
||||
codesign/entitlements/app_sandbox/helper_executables=[]
|
||||
codesign/entitlements/additional=""
|
||||
codesign/custom_options=PackedStringArray()
|
||||
notarization/notarization=0
|
||||
privacy/microphone_usage_description="So the guy can go up and down!"
|
||||
|
@ -191,6 +215,148 @@ privacy/network_volumes_usage_description=""
|
|||
privacy/network_volumes_usage_description_localized={}
|
||||
privacy/removable_volumes_usage_description=""
|
||||
privacy/removable_volumes_usage_description_localized={}
|
||||
privacy/tracking_enabled=false
|
||||
privacy/tracking_domains=PackedStringArray()
|
||||
privacy/collected_data/name/collected=false
|
||||
privacy/collected_data/name/linked_to_user=false
|
||||
privacy/collected_data/name/used_for_tracking=false
|
||||
privacy/collected_data/name/collection_purposes=0
|
||||
privacy/collected_data/email_address/collected=false
|
||||
privacy/collected_data/email_address/linked_to_user=false
|
||||
privacy/collected_data/email_address/used_for_tracking=false
|
||||
privacy/collected_data/email_address/collection_purposes=0
|
||||
privacy/collected_data/phone_number/collected=false
|
||||
privacy/collected_data/phone_number/linked_to_user=false
|
||||
privacy/collected_data/phone_number/used_for_tracking=false
|
||||
privacy/collected_data/phone_number/collection_purposes=0
|
||||
privacy/collected_data/physical_address/collected=false
|
||||
privacy/collected_data/physical_address/linked_to_user=false
|
||||
privacy/collected_data/physical_address/used_for_tracking=false
|
||||
privacy/collected_data/physical_address/collection_purposes=0
|
||||
privacy/collected_data/other_contact_info/collected=false
|
||||
privacy/collected_data/other_contact_info/linked_to_user=false
|
||||
privacy/collected_data/other_contact_info/used_for_tracking=false
|
||||
privacy/collected_data/other_contact_info/collection_purposes=0
|
||||
privacy/collected_data/health/collected=false
|
||||
privacy/collected_data/health/linked_to_user=false
|
||||
privacy/collected_data/health/used_for_tracking=false
|
||||
privacy/collected_data/health/collection_purposes=0
|
||||
privacy/collected_data/fitness/collected=false
|
||||
privacy/collected_data/fitness/linked_to_user=false
|
||||
privacy/collected_data/fitness/used_for_tracking=false
|
||||
privacy/collected_data/fitness/collection_purposes=0
|
||||
privacy/collected_data/payment_info/collected=false
|
||||
privacy/collected_data/payment_info/linked_to_user=false
|
||||
privacy/collected_data/payment_info/used_for_tracking=false
|
||||
privacy/collected_data/payment_info/collection_purposes=0
|
||||
privacy/collected_data/credit_info/collected=false
|
||||
privacy/collected_data/credit_info/linked_to_user=false
|
||||
privacy/collected_data/credit_info/used_for_tracking=false
|
||||
privacy/collected_data/credit_info/collection_purposes=0
|
||||
privacy/collected_data/other_financial_info/collected=false
|
||||
privacy/collected_data/other_financial_info/linked_to_user=false
|
||||
privacy/collected_data/other_financial_info/used_for_tracking=false
|
||||
privacy/collected_data/other_financial_info/collection_purposes=0
|
||||
privacy/collected_data/precise_location/collected=false
|
||||
privacy/collected_data/precise_location/linked_to_user=false
|
||||
privacy/collected_data/precise_location/used_for_tracking=false
|
||||
privacy/collected_data/precise_location/collection_purposes=0
|
||||
privacy/collected_data/coarse_location/collected=false
|
||||
privacy/collected_data/coarse_location/linked_to_user=false
|
||||
privacy/collected_data/coarse_location/used_for_tracking=false
|
||||
privacy/collected_data/coarse_location/collection_purposes=0
|
||||
privacy/collected_data/sensitive_info/collected=false
|
||||
privacy/collected_data/sensitive_info/linked_to_user=false
|
||||
privacy/collected_data/sensitive_info/used_for_tracking=false
|
||||
privacy/collected_data/sensitive_info/collection_purposes=0
|
||||
privacy/collected_data/contacts/collected=false
|
||||
privacy/collected_data/contacts/linked_to_user=false
|
||||
privacy/collected_data/contacts/used_for_tracking=false
|
||||
privacy/collected_data/contacts/collection_purposes=0
|
||||
privacy/collected_data/emails_or_text_messages/collected=false
|
||||
privacy/collected_data/emails_or_text_messages/linked_to_user=false
|
||||
privacy/collected_data/emails_or_text_messages/used_for_tracking=false
|
||||
privacy/collected_data/emails_or_text_messages/collection_purposes=0
|
||||
privacy/collected_data/photos_or_videos/collected=false
|
||||
privacy/collected_data/photos_or_videos/linked_to_user=false
|
||||
privacy/collected_data/photos_or_videos/used_for_tracking=false
|
||||
privacy/collected_data/photos_or_videos/collection_purposes=0
|
||||
privacy/collected_data/audio_data/collected=false
|
||||
privacy/collected_data/audio_data/linked_to_user=false
|
||||
privacy/collected_data/audio_data/used_for_tracking=false
|
||||
privacy/collected_data/audio_data/collection_purposes=0
|
||||
privacy/collected_data/gameplay_content/collected=false
|
||||
privacy/collected_data/gameplay_content/linked_to_user=false
|
||||
privacy/collected_data/gameplay_content/used_for_tracking=false
|
||||
privacy/collected_data/gameplay_content/collection_purposes=0
|
||||
privacy/collected_data/customer_support/collected=false
|
||||
privacy/collected_data/customer_support/linked_to_user=false
|
||||
privacy/collected_data/customer_support/used_for_tracking=false
|
||||
privacy/collected_data/customer_support/collection_purposes=0
|
||||
privacy/collected_data/other_user_content/collected=false
|
||||
privacy/collected_data/other_user_content/linked_to_user=false
|
||||
privacy/collected_data/other_user_content/used_for_tracking=false
|
||||
privacy/collected_data/other_user_content/collection_purposes=0
|
||||
privacy/collected_data/browsing_history/collected=false
|
||||
privacy/collected_data/browsing_history/linked_to_user=false
|
||||
privacy/collected_data/browsing_history/used_for_tracking=false
|
||||
privacy/collected_data/browsing_history/collection_purposes=0
|
||||
privacy/collected_data/search_hhistory/collected=false
|
||||
privacy/collected_data/search_hhistory/linked_to_user=false
|
||||
privacy/collected_data/search_hhistory/used_for_tracking=false
|
||||
privacy/collected_data/search_hhistory/collection_purposes=0
|
||||
privacy/collected_data/user_id/collected=false
|
||||
privacy/collected_data/user_id/linked_to_user=false
|
||||
privacy/collected_data/user_id/used_for_tracking=false
|
||||
privacy/collected_data/user_id/collection_purposes=0
|
||||
privacy/collected_data/device_id/collected=false
|
||||
privacy/collected_data/device_id/linked_to_user=false
|
||||
privacy/collected_data/device_id/used_for_tracking=false
|
||||
privacy/collected_data/device_id/collection_purposes=0
|
||||
privacy/collected_data/purchase_history/collected=false
|
||||
privacy/collected_data/purchase_history/linked_to_user=false
|
||||
privacy/collected_data/purchase_history/used_for_tracking=false
|
||||
privacy/collected_data/purchase_history/collection_purposes=0
|
||||
privacy/collected_data/product_interaction/collected=false
|
||||
privacy/collected_data/product_interaction/linked_to_user=false
|
||||
privacy/collected_data/product_interaction/used_for_tracking=false
|
||||
privacy/collected_data/product_interaction/collection_purposes=0
|
||||
privacy/collected_data/advertising_data/collected=false
|
||||
privacy/collected_data/advertising_data/linked_to_user=false
|
||||
privacy/collected_data/advertising_data/used_for_tracking=false
|
||||
privacy/collected_data/advertising_data/collection_purposes=0
|
||||
privacy/collected_data/other_usage_data/collected=false
|
||||
privacy/collected_data/other_usage_data/linked_to_user=false
|
||||
privacy/collected_data/other_usage_data/used_for_tracking=false
|
||||
privacy/collected_data/other_usage_data/collection_purposes=0
|
||||
privacy/collected_data/crash_data/collected=false
|
||||
privacy/collected_data/crash_data/linked_to_user=false
|
||||
privacy/collected_data/crash_data/used_for_tracking=false
|
||||
privacy/collected_data/crash_data/collection_purposes=0
|
||||
privacy/collected_data/performance_data/collected=false
|
||||
privacy/collected_data/performance_data/linked_to_user=false
|
||||
privacy/collected_data/performance_data/used_for_tracking=false
|
||||
privacy/collected_data/performance_data/collection_purposes=0
|
||||
privacy/collected_data/other_diagnostic_data/collected=false
|
||||
privacy/collected_data/other_diagnostic_data/linked_to_user=false
|
||||
privacy/collected_data/other_diagnostic_data/used_for_tracking=false
|
||||
privacy/collected_data/other_diagnostic_data/collection_purposes=0
|
||||
privacy/collected_data/environment_scanning/collected=false
|
||||
privacy/collected_data/environment_scanning/linked_to_user=false
|
||||
privacy/collected_data/environment_scanning/used_for_tracking=false
|
||||
privacy/collected_data/environment_scanning/collection_purposes=0
|
||||
privacy/collected_data/hands/collected=false
|
||||
privacy/collected_data/hands/linked_to_user=false
|
||||
privacy/collected_data/hands/used_for_tracking=false
|
||||
privacy/collected_data/hands/collection_purposes=0
|
||||
privacy/collected_data/head/collected=false
|
||||
privacy/collected_data/head/linked_to_user=false
|
||||
privacy/collected_data/head/used_for_tracking=false
|
||||
privacy/collected_data/head/collection_purposes=0
|
||||
privacy/collected_data/other_data_types/collected=false
|
||||
privacy/collected_data/other_data_types/linked_to_user=false
|
||||
privacy/collected_data/other_data_types/used_for_tracking=false
|
||||
privacy/collected_data/other_data_types/collection_purposes=0
|
||||
ssh_remote_deploy/enabled=false
|
||||
ssh_remote_deploy/host="user@host_ip"
|
||||
ssh_remote_deploy/port="22"
|
||||
|
@ -202,3 +368,4 @@ open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}"
|
|||
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
|
||||
kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\")
|
||||
rm -rf \"{temp_dir}\""
|
||||
application/min_macos_version="10.12"
|
||||
|
|
|
@ -1,144 +1,169 @@
|
|||
use std::collections::HashSet;
|
||||
|
||||
use device_query::{DeviceQuery, DeviceState, Keycode};
|
||||
use godot::{global::Key, prelude::*};
|
||||
use godot::{classes::Engine, global::Key, prelude::*};
|
||||
|
||||
struct MyExtension;
|
||||
|
||||
const SINGLETON_NAME: &str = "BackgroundInputCapture";
|
||||
|
||||
#[gdextension]
|
||||
unsafe impl ExtensionLibrary for MyExtension {}
|
||||
unsafe impl ExtensionLibrary for MyExtension {
|
||||
fn on_level_init(_level: InitLevel) {
|
||||
Engine::singleton()
|
||||
.register_singleton(SINGLETON_NAME, &BackgroundInputCapture::new_alloc());
|
||||
}
|
||||
|
||||
fn on_level_deinit(_level: InitLevel) {
|
||||
Engine::singleton().unregister_singleton(SINGLETON_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(GodotClass)]
|
||||
#[class(init, base = Node)]
|
||||
#[class(init, base = Object)]
|
||||
pub struct BackgroundInputCapture {
|
||||
device_state: DeviceState,
|
||||
base: Base<Node>,
|
||||
pressed_keys: HashSet<Keycode>,
|
||||
base: Base<Object>,
|
||||
}
|
||||
|
||||
#[godot_api]
|
||||
impl BackgroundInputCapture {
|
||||
#[func]
|
||||
pub fn get_keys(&mut self) -> Vec<i32> {
|
||||
self.device_state
|
||||
.get_keys()
|
||||
pub fn get_keys(&mut self) -> Dictionary {
|
||||
let keys: HashSet<Keycode> = self.device_state.get_keys().into_iter().collect();
|
||||
let just_pressed = keys.difference(&self.pressed_keys);
|
||||
let just_released = self.pressed_keys.difference(&keys);
|
||||
let output = just_pressed
|
||||
.into_iter()
|
||||
.filter_map(|k| {
|
||||
Some(
|
||||
match k {
|
||||
Keycode::Key0 => Key::KEY_0,
|
||||
Keycode::Key1 => Key::KEY_1,
|
||||
Keycode::Key2 => Key::KEY_2,
|
||||
Keycode::Key3 => Key::KEY_3,
|
||||
Keycode::Key4 => Key::KEY_4,
|
||||
Keycode::Key5 => Key::KEY_5,
|
||||
Keycode::Key6 => Key::KEY_6,
|
||||
Keycode::Key7 => Key::KEY_7,
|
||||
Keycode::Key8 => Key::KEY_8,
|
||||
Keycode::Key9 => Key::KEY_9,
|
||||
Keycode::A => Key::A,
|
||||
Keycode::B => Key::B,
|
||||
Keycode::C => Key::C,
|
||||
Keycode::D => Key::D,
|
||||
Keycode::E => Key::E,
|
||||
Keycode::F => Key::F,
|
||||
Keycode::G => Key::G,
|
||||
Keycode::H => Key::H,
|
||||
Keycode::I => Key::I,
|
||||
Keycode::J => Key::J,
|
||||
Keycode::K => Key::K,
|
||||
Keycode::L => Key::L,
|
||||
Keycode::M => Key::M,
|
||||
Keycode::N => Key::N,
|
||||
Keycode::O => Key::O,
|
||||
Keycode::P => Key::P,
|
||||
Keycode::Q => Key::Q,
|
||||
Keycode::R => Key::R,
|
||||
Keycode::S => Key::S,
|
||||
Keycode::T => Key::T,
|
||||
Keycode::U => Key::U,
|
||||
Keycode::V => Key::V,
|
||||
Keycode::W => Key::W,
|
||||
Keycode::X => Key::X,
|
||||
Keycode::Y => Key::Y,
|
||||
Keycode::Z => Key::Z,
|
||||
Keycode::F1 => Key::F1,
|
||||
Keycode::F2 => Key::F2,
|
||||
Keycode::F3 => Key::F3,
|
||||
Keycode::F4 => Key::F4,
|
||||
Keycode::F5 => Key::F5,
|
||||
Keycode::F6 => Key::F6,
|
||||
Keycode::F7 => Key::F7,
|
||||
Keycode::F8 => Key::F8,
|
||||
Keycode::F9 => Key::F9,
|
||||
Keycode::F10 => Key::F10,
|
||||
Keycode::F11 => Key::F11,
|
||||
Keycode::F12 => Key::F12,
|
||||
Keycode::F13 => Key::F13,
|
||||
Keycode::F14 => Key::F14,
|
||||
Keycode::F15 => Key::F15,
|
||||
Keycode::F16 => Key::F16,
|
||||
Keycode::F17 => Key::F17,
|
||||
Keycode::F18 => Key::F18,
|
||||
Keycode::F19 => Key::F19,
|
||||
Keycode::F20 => Key::F20,
|
||||
Keycode::Escape => Key::ESCAPE,
|
||||
Keycode::Space => Key::SPACE,
|
||||
Keycode::LControl => return None,
|
||||
Keycode::RControl => return None,
|
||||
Keycode::LShift => return None,
|
||||
Keycode::RShift => return None,
|
||||
Keycode::LAlt => return None,
|
||||
Keycode::RAlt => return None,
|
||||
Keycode::Command => return None,
|
||||
Keycode::RCommand => return None,
|
||||
Keycode::LOption => return None,
|
||||
Keycode::ROption => return None,
|
||||
Keycode::LMeta => return None,
|
||||
Keycode::RMeta => return None,
|
||||
Keycode::Enter => Key::ENTER,
|
||||
Keycode::Up => Key::UP,
|
||||
Keycode::Down => Key::DOWN,
|
||||
Keycode::Left => Key::LEFT,
|
||||
Keycode::Right => Key::RIGHT,
|
||||
Keycode::Backspace => Key::BACKSPACE,
|
||||
Keycode::CapsLock => Key::CAPSLOCK,
|
||||
Keycode::Tab => Key::TAB,
|
||||
Keycode::Home => Key::HOME,
|
||||
Keycode::End => Key::END,
|
||||
Keycode::PageUp => Key::PAGEUP,
|
||||
Keycode::PageDown => Key::PAGEDOWN,
|
||||
Keycode::Insert => Key::INSERT,
|
||||
Keycode::Delete => Key::DELETE,
|
||||
Keycode::Numpad0 => Key::KP_0,
|
||||
Keycode::Numpad1 => Key::KP_1,
|
||||
Keycode::Numpad2 => Key::KP_2,
|
||||
Keycode::Numpad3 => Key::KP_3,
|
||||
Keycode::Numpad4 => Key::KP_4,
|
||||
Keycode::Numpad5 => Key::KP_5,
|
||||
Keycode::Numpad6 => Key::KP_6,
|
||||
Keycode::Numpad7 => Key::KP_7,
|
||||
Keycode::Numpad8 => Key::KP_8,
|
||||
Keycode::Numpad9 => Key::KP_9,
|
||||
Keycode::NumpadSubtract => Key::KP_SUBTRACT,
|
||||
Keycode::NumpadAdd => Key::KP_ADD,
|
||||
Keycode::NumpadDivide => Key::KP_DIVIDE,
|
||||
Keycode::NumpadMultiply => Key::KP_MULTIPLY,
|
||||
Keycode::NumpadEquals => Key::EQUAL,
|
||||
Keycode::NumpadEnter => Key::KP_ENTER,
|
||||
Keycode::NumpadDecimal => Key::KP_PERIOD,
|
||||
Keycode::Grave => Key::QUOTELEFT,
|
||||
Keycode::Minus => Key::MINUS,
|
||||
Keycode::Equal => Key::EQUAL,
|
||||
Keycode::LeftBracket => Key::BRACKETLEFT,
|
||||
Keycode::RightBracket => Key::BRACKETRIGHT,
|
||||
Keycode::BackSlash => Key::BACKSLASH,
|
||||
Keycode::Semicolon => Key::SEMICOLON,
|
||||
Keycode::Apostrophe => Key::APOSTROPHE,
|
||||
Keycode::Comma => Key::COMMA,
|
||||
Keycode::Dot => Key::PERIOD,
|
||||
Keycode::Slash => Key::SLASH,
|
||||
}
|
||||
.to_godot(),
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
.filter_map(|k| Some((keycode_to_key(k)?, true)))
|
||||
.chain(
|
||||
just_released
|
||||
.into_iter()
|
||||
.filter_map(|k| Some((keycode_to_key(k)?, false))),
|
||||
)
|
||||
.collect();
|
||||
self.pressed_keys = keys;
|
||||
output
|
||||
}
|
||||
}
|
||||
|
||||
fn keycode_to_key(key: &Keycode) -> Option<i32> {
|
||||
Some(
|
||||
match key {
|
||||
Keycode::Key0 => Key::KEY_0,
|
||||
Keycode::Key1 => Key::KEY_1,
|
||||
Keycode::Key2 => Key::KEY_2,
|
||||
Keycode::Key3 => Key::KEY_3,
|
||||
Keycode::Key4 => Key::KEY_4,
|
||||
Keycode::Key5 => Key::KEY_5,
|
||||
Keycode::Key6 => Key::KEY_6,
|
||||
Keycode::Key7 => Key::KEY_7,
|
||||
Keycode::Key8 => Key::KEY_8,
|
||||
Keycode::Key9 => Key::KEY_9,
|
||||
Keycode::A => Key::A,
|
||||
Keycode::B => Key::B,
|
||||
Keycode::C => Key::C,
|
||||
Keycode::D => Key::D,
|
||||
Keycode::E => Key::E,
|
||||
Keycode::F => Key::F,
|
||||
Keycode::G => Key::G,
|
||||
Keycode::H => Key::H,
|
||||
Keycode::I => Key::I,
|
||||
Keycode::J => Key::J,
|
||||
Keycode::K => Key::K,
|
||||
Keycode::L => Key::L,
|
||||
Keycode::M => Key::M,
|
||||
Keycode::N => Key::N,
|
||||
Keycode::O => Key::O,
|
||||
Keycode::P => Key::P,
|
||||
Keycode::Q => Key::Q,
|
||||
Keycode::R => Key::R,
|
||||
Keycode::S => Key::S,
|
||||
Keycode::T => Key::T,
|
||||
Keycode::U => Key::U,
|
||||
Keycode::V => Key::V,
|
||||
Keycode::W => Key::W,
|
||||
Keycode::X => Key::X,
|
||||
Keycode::Y => Key::Y,
|
||||
Keycode::Z => Key::Z,
|
||||
Keycode::F1 => Key::F1,
|
||||
Keycode::F2 => Key::F2,
|
||||
Keycode::F3 => Key::F3,
|
||||
Keycode::F4 => Key::F4,
|
||||
Keycode::F5 => Key::F5,
|
||||
Keycode::F6 => Key::F6,
|
||||
Keycode::F7 => Key::F7,
|
||||
Keycode::F8 => Key::F8,
|
||||
Keycode::F9 => Key::F9,
|
||||
Keycode::F10 => Key::F10,
|
||||
Keycode::F11 => Key::F11,
|
||||
Keycode::F12 => Key::F12,
|
||||
Keycode::F13 => Key::F13,
|
||||
Keycode::F14 => Key::F14,
|
||||
Keycode::F15 => Key::F15,
|
||||
Keycode::F16 => Key::F16,
|
||||
Keycode::F17 => Key::F17,
|
||||
Keycode::F18 => Key::F18,
|
||||
Keycode::F19 => Key::F19,
|
||||
Keycode::F20 => Key::F20,
|
||||
Keycode::Escape => Key::ESCAPE,
|
||||
Keycode::Space => Key::SPACE,
|
||||
Keycode::LControl => return None,
|
||||
Keycode::RControl => return None,
|
||||
Keycode::LShift => return None,
|
||||
Keycode::RShift => return None,
|
||||
Keycode::LAlt => return None,
|
||||
Keycode::RAlt => return None,
|
||||
Keycode::Command => return None,
|
||||
Keycode::RCommand => return None,
|
||||
Keycode::LOption => return None,
|
||||
Keycode::ROption => return None,
|
||||
Keycode::LMeta => return None,
|
||||
Keycode::RMeta => return None,
|
||||
Keycode::Enter => Key::ENTER,
|
||||
Keycode::Up => Key::UP,
|
||||
Keycode::Down => Key::DOWN,
|
||||
Keycode::Left => Key::LEFT,
|
||||
Keycode::Right => Key::RIGHT,
|
||||
Keycode::Backspace => Key::BACKSPACE,
|
||||
Keycode::CapsLock => Key::CAPSLOCK,
|
||||
Keycode::Tab => Key::TAB,
|
||||
Keycode::Home => Key::HOME,
|
||||
Keycode::End => Key::END,
|
||||
Keycode::PageUp => Key::PAGEUP,
|
||||
Keycode::PageDown => Key::PAGEDOWN,
|
||||
Keycode::Insert => Key::INSERT,
|
||||
Keycode::Delete => Key::DELETE,
|
||||
Keycode::Numpad0 => Key::KP_0,
|
||||
Keycode::Numpad1 => Key::KP_1,
|
||||
Keycode::Numpad2 => Key::KP_2,
|
||||
Keycode::Numpad3 => Key::KP_3,
|
||||
Keycode::Numpad4 => Key::KP_4,
|
||||
Keycode::Numpad5 => Key::KP_5,
|
||||
Keycode::Numpad6 => Key::KP_6,
|
||||
Keycode::Numpad7 => Key::KP_7,
|
||||
Keycode::Numpad8 => Key::KP_8,
|
||||
Keycode::Numpad9 => Key::KP_9,
|
||||
Keycode::NumpadSubtract => Key::KP_SUBTRACT,
|
||||
Keycode::NumpadAdd => Key::KP_ADD,
|
||||
Keycode::NumpadDivide => Key::KP_DIVIDE,
|
||||
Keycode::NumpadMultiply => Key::KP_MULTIPLY,
|
||||
Keycode::NumpadEquals => Key::EQUAL,
|
||||
Keycode::NumpadEnter => Key::KP_ENTER,
|
||||
Keycode::NumpadDecimal => Key::KP_PERIOD,
|
||||
Keycode::Grave => Key::QUOTELEFT,
|
||||
Keycode::Minus => Key::MINUS,
|
||||
Keycode::Equal => Key::EQUAL,
|
||||
Keycode::LeftBracket => Key::BRACKETLEFT,
|
||||
Keycode::RightBracket => Key::BRACKETRIGHT,
|
||||
Keycode::BackSlash => Key::BACKSLASH,
|
||||
Keycode::Semicolon => Key::SEMICOLON,
|
||||
Keycode::Apostrophe => Key::APOSTROPHE,
|
||||
Keycode::Comma => Key::COMMA,
|
||||
Keycode::Dot => Key::PERIOD,
|
||||
Keycode::Slash => Key::SLASH,
|
||||
}
|
||||
.to_godot(),
|
||||
)
|
||||
}
|
||||
|
|
|
@ -4,15 +4,16 @@ importer="texture"
|
|||
type="CompressedTexture2D"
|
||||
uid="uid://brxkjnudq5pbi"
|
||||
path.s3tc="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"
|
||||
path.etc2="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.etc2.ctex"
|
||||
metadata={
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"imported_formats": ["s3tc_bptc", "etc2_astc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.svg"
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"]
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex", "res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.etc2.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
|
|
|
@ -133,7 +133,10 @@ func _ready():
|
|||
camera.position = origin.position
|
||||
|
||||
func _process(delta):
|
||||
process_key_presses($BackgroundInputCapture.get_keys())
|
||||
var keys = BackgroundInputCapture.get_keys()
|
||||
bgInputSprite(keys)
|
||||
process_key_presses(keys)
|
||||
|
||||
var hold = origin.get_parent().position.y
|
||||
|
||||
origin.get_parent().position.y += yVel * 0.0166
|
||||
|
@ -178,6 +181,8 @@ func isFileSystemOpen():
|
|||
|
||||
#Displays control panel whether or not application is focused
|
||||
func _notification(what):
|
||||
if !is_node_ready():
|
||||
return
|
||||
match what:
|
||||
SceneTree.NOTIFICATION_APPLICATION_FOCUS_OUT:
|
||||
controlPanel.visible = false
|
||||
|
@ -589,7 +594,8 @@ func process_key_presses(keys_pressed):
|
|||
var keyStrings = []
|
||||
|
||||
for i in keys_pressed:
|
||||
keyStrings.append(OS.get_keycode_string(i) if !OS.get_keycode_string(i).strip_edges().is_empty() else "Keycode" + str(i))
|
||||
if keys_pressed[i]:
|
||||
keyStrings.append(OS.get_keycode_string(i) if !OS.get_keycode_string(i).strip_edges().is_empty() else "Keycode" + str(i))
|
||||
|
||||
if fileSystemOpen:
|
||||
return
|
||||
|
@ -618,7 +624,7 @@ func process_key_presses(keys_pressed):
|
|||
|
||||
|
||||
|
||||
func bgInputSprite(node, keys_pressed):
|
||||
func bgInputSprite(keys_pressed):
|
||||
if fileSystemOpen:
|
||||
return
|
||||
var keyStrings = []
|
||||
|
|
|
@ -280,12 +280,19 @@ offset_bottom = -89.0
|
|||
text = "kaiakairos'"
|
||||
label_settings = SubResource("LabelSettings_qg0do")
|
||||
|
||||
[node name="versionNo" type="Label" parent="ControlPanel/VersionLabels/Label2"]
|
||||
layout_mode = 0
|
||||
offset_left = 144.0
|
||||
offset_top = 40.0
|
||||
offset_right = 282.0
|
||||
offset_bottom = 74.0
|
||||
[node name="Label3" type="Label" parent="ControlPanel/VersionLabels"]
|
||||
offset_left = -516.0
|
||||
offset_top = -92.0
|
||||
offset_right = -314.0
|
||||
offset_bottom = -58.0
|
||||
text = "(fixed by Charlotte)"
|
||||
label_settings = SubResource("LabelSettings_qg0do")
|
||||
|
||||
[node name="versionNo" type="Label" parent="ControlPanel/VersionLabels"]
|
||||
offset_left = -569.0
|
||||
offset_top = -83.0
|
||||
offset_right = -431.0
|
||||
offset_bottom = -49.0
|
||||
text = "v1.4.5"
|
||||
label_settings = SubResource("LabelSettings_xvf50")
|
||||
|
||||
|
@ -619,8 +626,6 @@ texture = ExtResource("24_joqmn")
|
|||
[node name="Camera2D" type="Camera2D" parent="."]
|
||||
position = Vector2(360, 360)
|
||||
|
||||
[node name="BackgroundInputCapture" type="BackgroundInputCapture" parent="."]
|
||||
|
||||
[node name="PushUpdates" parent="." instance=ExtResource("30_q43vl")]
|
||||
z_index = 4090
|
||||
position = Vector2(0, 720)
|
||||
|
|
|
@ -142,4 +142,5 @@ textures/canvas_textures/default_texture_filter=0
|
|||
textures/canvas_textures/default_texture_repeat=1
|
||||
renderer/rendering_method="gl_compatibility"
|
||||
renderer/rendering_method.mobile="gl_compatibility"
|
||||
textures/vram_compression/import_etc2_astc=true
|
||||
environment/defaults/default_clear_color=Color(0.376471, 0.376471, 0.376471, 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue