Skip to content

Commit 84c5dc5

Browse files
zicklagTekhnaeRaav
andauthored
feat: add MouseInputs to input collection. (#504)
Co-authored-by: Tekhnae Raav <[email protected]>
1 parent 72dd83f commit 84c5dc5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

framework_crates/bones_framework/src/input.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use bones_schema::HasSchema;
44

5-
use self::prelude::{GamepadInputs, KeyboardInputs};
5+
use self::prelude::{GamepadInputs, KeyboardInputs, MouseInputs};
66

77
pub mod gamepad;
88
pub mod gilrs;
@@ -52,6 +52,7 @@ pub trait InputCollector<'a, ControlMapping: HasSchema, ControlSource, Control>:
5252
fn apply_inputs(
5353
&mut self,
5454
mapping: &ControlMapping,
55+
mouse: &MouseInputs,
5556
keyboard: &KeyboardInputs,
5657
gamepad: &GamepadInputs,
5758
);

framework_crates/bones_framework/src/networking.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,7 @@ where
724724
let mut skip_frames: u32 = 0;
725725

726726
{
727+
let mouse = world.resource::<MouseInputs>();
727728
let keyboard = world.resource::<KeyboardInputs>();
728729
let gamepad = world.resource::<GamepadInputs>();
729730

@@ -732,6 +733,7 @@ where
732733
// Collect inputs and update controls
733734
self.input_collector.apply_inputs(
734735
&world.resource::<ControlMapping<InputTypes>>(),
736+
&mouse,
735737
&keyboard,
736738
&gamepad,
737739
);

0 commit comments

Comments
 (0)