@@ -199,114 +199,114 @@ impl InputPreprocessorMessageHandler {
199
199
}
200
200
}
201
201
202
- #[ cfg( test) ]
203
- mod test {
204
- use crate :: messages:: input_mapper:: utility_types:: input_keyboard:: { Key , ModifierKeys } ;
205
- use crate :: messages:: input_mapper:: utility_types:: input_mouse:: { EditorMouseState , MouseKeys , ScrollDelta } ;
206
- use crate :: messages:: portfolio:: utility_types:: KeyboardPlatformLayout ;
207
- use crate :: messages:: prelude:: * ;
208
-
209
- #[ test]
210
- fn process_action_mouse_move_handle_modifier_keys ( ) {
211
- let mut input_preprocessor = InputPreprocessorMessageHandler :: default ( ) ;
212
-
213
- let editor_mouse_state = EditorMouseState {
214
- editor_position : ( 4. , 809. ) . into ( ) ,
215
- mouse_keys : MouseKeys :: default ( ) ,
216
- scroll_delta : ScrollDelta :: default ( ) ,
217
- } ;
218
- let modifier_keys = ModifierKeys :: ALT ;
219
- let message = InputPreprocessorMessage :: PointerMove { editor_mouse_state, modifier_keys } ;
220
-
221
- let mut responses = VecDeque :: new ( ) ;
222
-
223
- let data = InputPreprocessorMessageData {
224
- keyboard_platform : KeyboardPlatformLayout :: Standard ,
225
- } ;
226
- input_preprocessor. process_message ( message, & mut responses, data) ;
227
-
228
- assert ! ( input_preprocessor. keyboard. get( Key :: Alt as usize ) ) ;
229
- assert_eq ! ( responses. pop_front( ) , Some ( InputMapperMessage :: KeyDown ( Key :: Alt ) . into( ) ) ) ;
230
- }
231
-
232
- #[ test]
233
- fn process_action_mouse_down_handle_modifier_keys ( ) {
234
- let mut input_preprocessor = InputPreprocessorMessageHandler :: default ( ) ;
235
-
236
- let editor_mouse_state = EditorMouseState :: default ( ) ;
237
- let modifier_keys = ModifierKeys :: CONTROL ;
238
- let message = InputPreprocessorMessage :: PointerDown { editor_mouse_state, modifier_keys } ;
239
-
240
- let mut responses = VecDeque :: new ( ) ;
241
-
242
- let data = InputPreprocessorMessageData {
243
- keyboard_platform : KeyboardPlatformLayout :: Standard ,
244
- } ;
245
- input_preprocessor. process_message ( message, & mut responses, data) ;
246
-
247
- assert ! ( input_preprocessor. keyboard. get( Key :: Control as usize ) ) ;
248
- assert_eq ! ( responses. pop_front( ) , Some ( InputMapperMessage :: KeyDown ( Key :: Control ) . into( ) ) ) ;
249
- }
250
-
251
- #[ test]
252
- fn process_action_mouse_up_handle_modifier_keys ( ) {
253
- let mut input_preprocessor = InputPreprocessorMessageHandler :: default ( ) ;
254
-
255
- let editor_mouse_state = EditorMouseState :: default ( ) ;
256
- let modifier_keys = ModifierKeys :: SHIFT ;
257
- let message = InputPreprocessorMessage :: PointerUp { editor_mouse_state, modifier_keys } ;
258
-
259
- let mut responses = VecDeque :: new ( ) ;
260
-
261
- let data = InputPreprocessorMessageData {
262
- keyboard_platform : KeyboardPlatformLayout :: Standard ,
263
- } ;
264
- input_preprocessor. process_message ( message, & mut responses, data) ;
265
-
266
- assert ! ( input_preprocessor. keyboard. get( Key :: Shift as usize ) ) ;
267
- assert_eq ! ( responses. pop_front( ) , Some ( InputMapperMessage :: KeyDown ( Key :: Shift ) . into( ) ) ) ;
268
- }
269
-
270
- #[ test]
271
- fn process_action_key_down_handle_modifier_keys ( ) {
272
- let mut input_preprocessor = InputPreprocessorMessageHandler :: default ( ) ;
273
- input_preprocessor. keyboard . set ( Key :: Control as usize ) ;
274
-
275
- let key = Key :: KeyA ;
276
- let key_repeat = false ;
277
- let modifier_keys = ModifierKeys :: empty ( ) ;
278
- let message = InputPreprocessorMessage :: KeyDown { key, key_repeat, modifier_keys } ;
279
-
280
- let mut responses = VecDeque :: new ( ) ;
281
-
282
- let data = InputPreprocessorMessageData {
283
- keyboard_platform : KeyboardPlatformLayout :: Standard ,
284
- } ;
285
- input_preprocessor. process_message ( message, & mut responses, data) ;
286
-
287
- assert ! ( !input_preprocessor. keyboard. get( Key :: Control as usize ) ) ;
288
- assert_eq ! ( responses. pop_front( ) , Some ( InputMapperMessage :: KeyUp ( Key :: Control ) . into( ) ) ) ;
289
- }
290
-
291
- #[ test]
292
- fn process_action_key_up_handle_modifier_keys ( ) {
293
- let mut input_preprocessor = InputPreprocessorMessageHandler :: default ( ) ;
294
-
295
- let key = Key :: KeyS ;
296
- let key_repeat = false ;
297
- let modifier_keys = ModifierKeys :: CONTROL | ModifierKeys :: SHIFT ;
298
- let message = InputPreprocessorMessage :: KeyUp { key, key_repeat, modifier_keys } ;
299
-
300
- let mut responses = VecDeque :: new ( ) ;
301
-
302
- let data = InputPreprocessorMessageData {
303
- keyboard_platform : KeyboardPlatformLayout :: Standard ,
304
- } ;
305
- input_preprocessor. process_message ( message, & mut responses, data) ;
306
-
307
- assert ! ( input_preprocessor. keyboard. get( Key :: Control as usize ) ) ;
308
- assert ! ( input_preprocessor. keyboard. get( Key :: Shift as usize ) ) ;
309
- assert ! ( responses. contains( & InputMapperMessage :: KeyDown ( Key :: Control ) . into( ) ) ) ;
310
- assert ! ( responses. contains( & InputMapperMessage :: KeyDown ( Key :: Control ) . into( ) ) ) ;
311
- }
312
- }
202
+ // #[cfg(test)]
203
+ // mod test {
204
+ // use crate::messages::input_mapper::utility_types::input_keyboard::{Key, ModifierKeys};
205
+ // use crate::messages::input_mapper::utility_types::input_mouse::{EditorMouseState, MouseKeys, ScrollDelta};
206
+ // use crate::messages::portfolio::utility_types::KeyboardPlatformLayout;
207
+ // use crate::messages::prelude::*;
208
+
209
+ // #[test]
210
+ // fn process_action_mouse_move_handle_modifier_keys() {
211
+ // let mut input_preprocessor = InputPreprocessorMessageHandler::default();
212
+
213
+ // let editor_mouse_state = EditorMouseState {
214
+ // editor_position: (4., 809.).into(),
215
+ // mouse_keys: MouseKeys::default(),
216
+ // scroll_delta: ScrollDelta::default(),
217
+ // };
218
+ // let modifier_keys = ModifierKeys::ALT;
219
+ // let message = InputPreprocessorMessage::PointerMove { editor_mouse_state, modifier_keys };
220
+
221
+ // let mut responses = VecDeque::new();
222
+
223
+ // let data = InputPreprocessorMessageData {
224
+ // keyboard_platform: KeyboardPlatformLayout::Standard,
225
+ // };
226
+ // input_preprocessor.process_message(message, &mut responses, data);
227
+
228
+ // assert!(input_preprocessor.keyboard.get(Key::Alt as usize));
229
+ // assert_eq!(responses.pop_front(), Some(InputMapperMessage::KeyDown(Key::Alt).into()));
230
+ // }
231
+
232
+ // #[test]
233
+ // fn process_action_mouse_down_handle_modifier_keys() {
234
+ // let mut input_preprocessor = InputPreprocessorMessageHandler::default();
235
+
236
+ // let editor_mouse_state = EditorMouseState::default();
237
+ // let modifier_keys = ModifierKeys::CONTROL;
238
+ // let message = InputPreprocessorMessage::PointerDown { editor_mouse_state, modifier_keys };
239
+
240
+ // let mut responses = VecDeque::new();
241
+
242
+ // let data = InputPreprocessorMessageData {
243
+ // keyboard_platform: KeyboardPlatformLayout::Standard,
244
+ // };
245
+ // input_preprocessor.process_message(message, &mut responses, data);
246
+
247
+ // assert!(input_preprocessor.keyboard.get(Key::Control as usize));
248
+ // assert_eq!(responses.pop_front(), Some(InputMapperMessage::KeyDown(Key::Control).into()));
249
+ // }
250
+
251
+ // #[test]
252
+ // fn process_action_mouse_up_handle_modifier_keys() {
253
+ // let mut input_preprocessor = InputPreprocessorMessageHandler::default();
254
+
255
+ // let editor_mouse_state = EditorMouseState::default();
256
+ // let modifier_keys = ModifierKeys::SHIFT;
257
+ // let message = InputPreprocessorMessage::PointerUp { editor_mouse_state, modifier_keys };
258
+
259
+ // let mut responses = VecDeque::new();
260
+
261
+ // let data = InputPreprocessorMessageData {
262
+ // keyboard_platform: KeyboardPlatformLayout::Standard,
263
+ // };
264
+ // input_preprocessor.process_message(message, &mut responses, data);
265
+
266
+ // assert!(input_preprocessor.keyboard.get(Key::Shift as usize));
267
+ // assert_eq!(responses.pop_front(), Some(InputMapperMessage::KeyDown(Key::Shift).into()));
268
+ // }
269
+
270
+ // #[test]
271
+ // fn process_action_key_down_handle_modifier_keys() {
272
+ // let mut input_preprocessor = InputPreprocessorMessageHandler::default();
273
+ // input_preprocessor.keyboard.set(Key::Control as usize);
274
+
275
+ // let key = Key::KeyA;
276
+ // let key_repeat = false;
277
+ // let modifier_keys = ModifierKeys::empty();
278
+ // let message = InputPreprocessorMessage::KeyDown { key, key_repeat, modifier_keys };
279
+
280
+ // let mut responses = VecDeque::new();
281
+
282
+ // let data = InputPreprocessorMessageData {
283
+ // keyboard_platform: KeyboardPlatformLayout::Standard,
284
+ // };
285
+ // input_preprocessor.process_message(message, &mut responses, data);
286
+
287
+ // assert!(!input_preprocessor.keyboard.get(Key::Control as usize));
288
+ // assert_eq!(responses.pop_front(), Some(InputMapperMessage::KeyUp(Key::Control).into()));
289
+ // }
290
+
291
+ // #[test]
292
+ // fn process_action_key_up_handle_modifier_keys() {
293
+ // let mut input_preprocessor = InputPreprocessorMessageHandler::default();
294
+
295
+ // let key = Key::KeyS;
296
+ // let key_repeat = false;
297
+ // let modifier_keys = ModifierKeys::CONTROL | ModifierKeys::SHIFT;
298
+ // let message = InputPreprocessorMessage::KeyUp { key, key_repeat, modifier_keys };
299
+
300
+ // let mut responses = VecDeque::new();
301
+
302
+ // let data = InputPreprocessorMessageData {
303
+ // keyboard_platform: KeyboardPlatformLayout::Standard,
304
+ // };
305
+ // input_preprocessor.process_message(message, &mut responses, data);
306
+
307
+ // assert!(input_preprocessor.keyboard.get(Key::Control as usize));
308
+ // assert!(input_preprocessor.keyboard.get(Key::Shift as usize));
309
+ // assert!(responses.contains(&InputMapperMessage::KeyDown(Key::Control).into()));
310
+ // assert!(responses.contains(&InputMapperMessage::KeyDown(Key::Control).into()));
311
+ // }
312
+ // }
0 commit comments