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