Skip to content

Commit

Permalink
remove physical keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
stutxo committed Sep 5, 2023
1 parent f77483e commit aa41d59
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 42 deletions.
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>☔ rain.run</title>
<script type="module">import init from './satrunner-825160e64388631.js';init('./satrunner-825160e64388631_bg.wasm');</script>
<script type="module">import init from './satrunner-f568c2f120206f47.js';init('./satrunner-f568c2f120206f47_bg.wasm');</script>


<style>
Expand All @@ -17,8 +17,8 @@
}
</style>

<link rel="preload" href="./satrunner-825160e64388631_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-825160e64388631.js"></head>
<link rel="preload" href="./satrunner-f568c2f120206f47_bg.wasm" as="fetch" type="application/wasm" crossorigin="">
<link rel="modulepreload" href="./satrunner-f568c2f120206f47.js"></head>

<body>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1889,59 +1889,59 @@ function __wbg_get_imports() {
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper43781 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper43780 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper43785 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper43784 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper43788 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper43787 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper43791 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper43790 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper43794 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper43793 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper43797 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper43796 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper43800 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper43799 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper44148 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper44147 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper45271 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper45270 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper45274 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper45273 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper45277 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper45276 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper45279 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper45278 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_37);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper49099 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper49098 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_34);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper51493 = function(arg0, arg1, arg2) {
imports.wbg.__wbindgen_closure_wrapper51477 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 2651, __wbg_adapter_37);
return addHeapObject(ret);
};
Expand Down Expand Up @@ -1986,7 +1986,7 @@ async function __wbg_init(input) {
if (wasm !== undefined) return wasm;

if (typeof input === 'undefined') {
input = new URL('satrunner-825160e64388631_bg.wasm', import.meta.url);
input = new URL('satrunner-f568c2f120206f47_bg.wasm', import.meta.url);
}
const imports = __wbg_get_imports();

Expand Down
Binary file not shown.
8 changes: 2 additions & 6 deletions src/keyboard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use self::{
components::KeyBoard,
layout::setup_keyboard,
resources::CapitalizeToggle,
systems::{physical_keyboard_system, virtual_capitalize_system, virtual_keyboard_system},
systems::{virtual_capitalize_system, virtual_keyboard_system},
};

pub mod components;
Expand All @@ -25,11 +25,7 @@ impl Plugin for KeyboardPlugin {
.add_systems(OnEnter(KeyboardState::On), setup_keyboard)
.add_systems(
Update,
(
physical_keyboard_system,
virtual_keyboard_system,
virtual_capitalize_system,
)
(virtual_keyboard_system, virtual_capitalize_system)
.run_if(in_state(KeyboardState::On)),
)
.add_systems(OnExit(KeyboardState::On), despawn_screen::<KeyBoard>);
Expand Down
36 changes: 18 additions & 18 deletions src/keyboard/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ use super::{

const ACCEPTABLE_CHARS: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 @.";
const MAX_INPUT_LENGTH: usize = 100;
#[allow(clippy::type_complexity)]
pub fn physical_keyboard_system(
mut char_evr: EventReader<ReceivedCharacter>,
keys: Res<Input<KeyCode>>,
// #[allow(clippy::type_complexity)]
// pub fn physical_keyboard_system(
// mut char_evr: EventReader<ReceivedCharacter>,
// keys: Res<Input<KeyCode>>,

mut player_name: ResMut<PlayerName>,
) {
if keys.just_pressed(KeyCode::Back) {
player_name.name.pop();
}
// mut player_name: ResMut<PlayerName>,
// ) {
// if keys.just_pressed(KeyCode::Back) {
// player_name.name.pop();
// }

for ev in char_evr.iter() {
let k = ev.char;
// for ev in char_evr.iter() {
// let k = ev.char;

if ACCEPTABLE_CHARS.contains(k) && player_name.name.len() < MAX_INPUT_LENGTH {
player_name.name.push(k);
} else {
info!("no likey this character sorry")
}
}
}
// if ACCEPTABLE_CHARS.contains(k) && player_name.name.len() < MAX_INPUT_LENGTH {
// player_name.name.push(k);
// } else {
// info!("no likey this character sorry")
// }
// }
// }

#[allow(clippy::type_complexity)]
pub fn virtual_keyboard_system(
Expand Down

0 comments on commit aa41d59

Please sign in to comment.