@@ -55,9 +55,9 @@ AndroidGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
55
55
56
56
_app = panda_android_app;
57
57
58
- GraphicsWindowInputDevice device =
59
- GraphicsWindowInputDevice::pointer_and_keyboard (this , " keyboard_mouse" );
58
+ PT (GraphicsWindowInputDevice) device = GraphicsWindowInputDevice::pointer_and_keyboard (this , " keyboard_mouse" );
60
59
add_input_device (device);
60
+ _input = device;
61
61
}
62
62
63
63
/* *
@@ -486,22 +486,22 @@ handle_key_event(const AInputEvent *event) {
486
486
/*
487
487
int32_t meta = AKeyEvent_getMetaState(event);
488
488
if (meta | AMETA_ALT_ON) {
489
- _input_devices[0]. button_down(KeyboardButton.alt());
489
+ _input-> button_down(KeyboardButton.alt());
490
490
}
491
491
if (meta | AMETA_ALT_LEFT_ON) {
492
- _input_devices[0]. button_down(KeyboardButton.lalt());
492
+ _input-> button_down(KeyboardButton.lalt());
493
493
}
494
494
if (meta | AMETA_ALT_RIGHT_ON) {
495
- _input_devices[0]. button_down(KeyboardButton.ralt());
495
+ _input-> button_down(KeyboardButton.ralt());
496
496
}
497
497
if (meta | AMETA_SHIFT_ON) {
498
- _input_devices[0]. button_down(KeyboardButton.shift());
498
+ _input-> button_down(KeyboardButton.shift());
499
499
}
500
500
if (meta | AMETA_SHIFT_LEFT_ON) {
501
- _input_devices[0]. button_down(KeyboardButton.lshift());
501
+ _input-> button_down(KeyboardButton.lshift());
502
502
}
503
503
if (meta | AMETA_SHIFT_RIGHT_ON) {
504
- _input_devices[0]. button_down(KeyboardButton.rshift());
504
+ _input-> button_down(KeyboardButton.rshift());
505
505
}*/
506
506
507
507
int32_t keycode = AKeyEvent_getKeyCode (event);
@@ -517,12 +517,12 @@ handle_key_event(const AInputEvent *event) {
517
517
int32_t action = AKeyEvent_getAction (event);
518
518
if (action == AKEY_EVENT_ACTION_DOWN) {
519
519
if (AKeyEvent_getRepeatCount (event) > 0 ) {
520
- _input_devices[ 0 ]. button_resume_down (button);
520
+ _input-> button_resume_down (button);
521
521
} else {
522
- _input_devices[ 0 ]. button_down (button);
522
+ _input-> button_down (button);
523
523
}
524
524
} else if (action == AKEY_EVENT_ACTION_UP) {
525
- _input_devices[ 0 ]. button_up (button);
525
+ _input-> button_up (button);
526
526
}
527
527
// TODO AKEY_EVENT_ACTION_MULTIPLE
528
528
@@ -549,16 +549,16 @@ handle_motion_event(const AInputEvent *event) {
549
549
if (changed != 0 ) {
550
550
if (changed & AMOTION_EVENT_BUTTON_PRIMARY) {
551
551
if (button_state & AMOTION_EVENT_BUTTON_PRIMARY) {
552
- _input_devices[ 0 ]. button_down (MouseButton::one ());
552
+ _input-> button_down (MouseButton::one ());
553
553
} else {
554
- _input_devices[ 0 ]. button_up (MouseButton::one ());
554
+ _input-> button_up (MouseButton::one ());
555
555
}
556
556
}
557
557
if (changed & AMOTION_EVENT_BUTTON_SECONDARY) {
558
558
if (button_state & AMOTION_EVENT_BUTTON_SECONDARY) {
559
- _input_devices[ 0 ]. button_down (MouseButton::three ());
559
+ _input-> button_down (MouseButton::three ());
560
560
} else {
561
- _input_devices[ 0 ]. button_up (MouseButton::three ());
561
+ _input-> button_up (MouseButton::three ());
562
562
}
563
563
}
564
564
_mouse_button_state = button_state;
@@ -568,7 +568,7 @@ handle_motion_event(const AInputEvent *event) {
568
568
float x = AMotionEvent_getX (event, 0 ) - _app->contentRect .left ;
569
569
float y = AMotionEvent_getY (event, 0 ) - _app->contentRect .top ;
570
570
571
- _input_devices[ 0 ]. set_pointer_in_window (x, y);
571
+ _input-> set_pointer_in_window (x, y);
572
572
573
573
return 1 ;
574
574
}
0 commit comments