@@ -9,7 +9,7 @@ use widget::{Id, Index};
99
1010#[ test]
1111fn resetting_input_should_set_starting_state_to_current_state ( ) {
12- let mut input = GlobalInput :: new ( ) ;
12+ let mut input = GlobalInput :: new ( 0.0 ) ;
1313 input. push_event ( UiEvent :: Raw ( Input :: Press ( Keyboard ( Key :: LShift ) ) ) ) ;
1414 input. push_event ( UiEvent :: Raw ( Input :: Move ( Motion :: MouseScroll ( 0.0 , 50.0 ) ) ) ) ;
1515
@@ -20,7 +20,7 @@ fn resetting_input_should_set_starting_state_to_current_state() {
2020
2121#[ test]
2222fn resetting_input_should_clear_out_all_events ( ) {
23- let mut input = GlobalInput :: new ( ) ;
23+ let mut input = GlobalInput :: new ( 0.0 ) ;
2424 input. push_event ( UiEvent :: Raw ( Input :: Press ( Keyboard ( Key :: LShift ) ) ) ) ;
2525 input. push_event ( UiEvent :: Raw ( Input :: Move ( Motion :: MouseScroll ( 0.0 , 50.0 ) ) ) ) ;
2626 input. reset ( ) ;
@@ -29,7 +29,7 @@ fn resetting_input_should_clear_out_all_events() {
2929
3030#[ test]
3131fn scroll_events_should_have_modifier_keys ( ) {
32- let mut input = GlobalInput :: new ( ) ;
32+ let mut input = GlobalInput :: new ( 0.0 ) ;
3333
3434 input. push_event ( UiEvent :: Raw ( Input :: Press ( Keyboard ( Key :: LShift ) ) ) ) ;
3535 input. push_event ( UiEvent :: Raw ( Input :: Move ( Motion :: MouseScroll ( 0.0 , 50.0 ) ) ) ) ;
@@ -40,7 +40,7 @@ fn scroll_events_should_have_modifier_keys() {
4040
4141#[ test]
4242fn global_input_should_track_widget_currently_capturing_keyboard ( ) {
43- let mut input = GlobalInput :: new ( ) ;
43+ let mut input = GlobalInput :: new ( 0.0 ) ;
4444
4545 let idx: Index = Index :: Public ( Id ( 5 ) ) ;
4646 input. push_event ( UiEvent :: WidgetCapturesKeyboard ( idx) ) ;
@@ -57,7 +57,7 @@ fn global_input_should_track_widget_currently_capturing_keyboard() {
5757
5858#[ test]
5959fn global_input_should_track_widget_currently_capturing_mouse ( ) {
60- let mut input = GlobalInput :: new ( ) ;
60+ let mut input = GlobalInput :: new ( 0.0 ) ;
6161
6262 let idx: Index = Index :: Public ( Id ( 5 ) ) ;
6363 input. push_event ( UiEvent :: WidgetCapturesMouse ( idx) ) ;
@@ -74,15 +74,15 @@ fn global_input_should_track_widget_currently_capturing_mouse() {
7474
7575#[ test]
7676fn global_input_should_track_current_mouse_position ( ) {
77- let mut input = GlobalInput :: new ( ) ;
77+ let mut input = GlobalInput :: new ( 0.0 ) ;
7878
7979 input. push_event ( mouse_move_event ( 50.0 , 77.7 ) ) ;
8080 assert_eq ! ( [ 50.0 , 77.7 ] , input. mouse_position( ) ) ;
8181}
8282
8383#[ test]
8484fn entered_text_should_be_aggregated_from_multiple_events ( ) {
85- let mut input = GlobalInput :: new ( ) ;
85+ let mut input = GlobalInput :: new ( 0.0 ) ;
8686
8787 input. push_event ( UiEvent :: Raw ( Input :: Text ( "Phil " . to_string ( ) ) ) ) ;
8888 input. push_event ( UiEvent :: Raw ( Input :: Text ( "is a" . to_string ( ) ) ) ) ;
@@ -94,7 +94,7 @@ fn entered_text_should_be_aggregated_from_multiple_events() {
9494
9595#[ test]
9696fn drag_event_should_still_be_created_if_reset_is_called_between_press_and_release ( ) {
97- let mut input = GlobalInput :: new ( ) ;
97+ let mut input = GlobalInput :: new ( 4.0 ) ;
9898
9999 input. push_event ( UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ) ;
100100 input. push_event ( mouse_move_event ( 50.0 , 77.7 ) ) ;
@@ -106,7 +106,7 @@ fn drag_event_should_still_be_created_if_reset_is_called_between_press_and_relea
106106
107107#[ test]
108108fn click_event_should_still_be_created_if_reset_is_called_between_press_and_release ( ) {
109- let mut input = GlobalInput :: new ( ) ;
109+ let mut input = GlobalInput :: new ( 4.0 ) ;
110110
111111 input. push_event ( UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ) ;
112112 input. reset ( ) ;
@@ -117,7 +117,7 @@ fn click_event_should_still_be_created_if_reset_is_called_between_press_and_rele
117117
118118#[ test]
119119fn no_events_should_be_returned_after_reset_is_called ( ) {
120- let mut input = GlobalInput :: new ( ) ;
120+ let mut input = GlobalInput :: new ( 0.0 ) ;
121121 input. push_event ( UiEvent :: Raw ( Input :: Press ( Keyboard ( Key :: RShift ) ) ) ) ;
122122 input. push_event ( UiEvent :: Raw ( Input :: Move ( Motion :: MouseScroll ( 7.0 , 88.5 ) ) ) ) ;
123123 input. push_event ( UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ) ;
@@ -133,7 +133,7 @@ fn no_events_should_be_returned_after_reset_is_called() {
133133fn drag_with_modifer_key_should_include_modifiers_in_drag_event ( ) {
134134 use input:: keyboard:: SHIFT ;
135135
136- let mut input = GlobalInput :: new ( ) ;
136+ let mut input = GlobalInput :: new ( 4.0 ) ;
137137 input. push_event ( UiEvent :: Raw ( Input :: Press ( Keyboard ( Key :: RShift ) ) ) ) ;
138138 input. push_event ( UiEvent :: Raw ( Input :: Move ( Motion :: MouseScroll ( 7.0 , 88.5 ) ) ) ) ;
139139
@@ -146,7 +146,7 @@ fn drag_with_modifer_key_should_include_modifiers_in_drag_event() {
146146fn click_with_modifier_key_should_include_modifiers_in_click_event ( ) {
147147 use input:: keyboard:: CTRL ;
148148
149- let mut input = GlobalInput :: new ( ) ;
149+ let mut input = GlobalInput :: new ( 4.0 ) ;
150150 input. push_event ( UiEvent :: Raw ( Input :: Press ( Keyboard ( Key :: LCtrl ) ) ) ) ;
151151 input. push_event ( UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ) ;
152152 input. push_event ( UiEvent :: Raw ( Input :: Release ( Mouse ( MouseButton :: Left ) ) ) ) ;
@@ -162,7 +162,7 @@ fn click_with_modifier_key_should_include_modifiers_in_click_event() {
162162
163163#[ test]
164164fn high_level_scroll_event_should_be_created_from_a_raw_mouse_scroll ( ) {
165- let mut input = GlobalInput :: new ( ) ;
165+ let mut input = GlobalInput :: new ( 0.0 ) ;
166166
167167 input. push_event ( UiEvent :: Raw ( Input :: Move ( Motion :: MouseScroll ( 10.0 , 33.0 ) ) ) ) ;
168168
@@ -177,7 +177,7 @@ fn high_level_scroll_event_should_be_created_from_a_raw_mouse_scroll() {
177177
178178#[ test]
179179fn mouse_button_pressed_moved_released_creates_final_drag_event ( ) {
180- let mut input = GlobalInput :: new ( ) ;
180+ let mut input = GlobalInput :: new ( 4.0 ) ;
181181
182182 input. push_event ( UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ) ;
183183 input. push_event ( mouse_move_event ( 20.0 , 10.0 ) ) ;
@@ -196,7 +196,7 @@ fn mouse_button_pressed_moved_released_creates_final_drag_event() {
196196
197197#[ test]
198198fn mouse_button_pressed_then_moved_creates_drag_event ( ) {
199- let mut input = GlobalInput :: new ( ) ;
199+ let mut input = GlobalInput :: new ( 4.0 ) ;
200200
201201 let press = UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ;
202202 let mouse_move = mouse_move_event ( 20.0 , 10.0 ) ;
@@ -216,7 +216,7 @@ fn mouse_button_pressed_then_moved_creates_drag_event() {
216216
217217#[ test]
218218fn mouse_click_position_should_be_mouse_position_when_pressed ( ) {
219- let mut input = GlobalInput :: new ( ) ;
219+ let mut input = GlobalInput :: new ( 4.0 ) ;
220220
221221 input. push_event ( mouse_move_event ( 4.0 , 5.0 ) ) ;
222222 input. push_event ( UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ) ;
@@ -236,7 +236,7 @@ fn mouse_click_position_should_be_mouse_position_when_pressed() {
236236
237237#[ test]
238238fn mouse_button_pressed_then_released_should_create_mouse_click_event ( ) {
239- let mut input = GlobalInput :: new ( ) ;
239+ let mut input = GlobalInput :: new ( 4.0 ) ;
240240
241241 let press = UiEvent :: Raw ( Input :: Press ( Mouse ( MouseButton :: Left ) ) ) ;
242242 let release = UiEvent :: Raw ( Input :: Release ( Mouse ( MouseButton :: Left ) ) ) ;
@@ -255,7 +255,7 @@ fn mouse_button_pressed_then_released_should_create_mouse_click_event() {
255255
256256#[ test]
257257fn all_events_should_return_all_inputs_in_order ( ) {
258- let mut input = GlobalInput :: new ( ) ;
258+ let mut input = GlobalInput :: new ( 0.0 ) ;
259259
260260 let evt1 = UiEvent :: Raw ( Input :: Press ( Keyboard ( Key :: Z ) ) ) ;
261261 input. push_event ( evt1. clone ( ) ) ;
0 commit comments