mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-21 07:46:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fa761debc4 | ||
|
|
62e175f069 | ||
|
|
d7d8c40565 | ||
|
|
64de13ab50 | ||
|
|
2f02939638 | ||
|
|
1d7c8697e9 |
No files matched your search
+2
-2
@@ -8,8 +8,8 @@ android {
|
|||||||
minSdkVersion 16
|
minSdkVersion 16
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
|
|
||||||
versionName "5.9.2"
|
versionName "5.9.3"
|
||||||
versionCode = 171
|
versionCode = 172
|
||||||
}
|
}
|
||||||
|
|
||||||
flavorDimensions "root"
|
flavorDimensions "root"
|
||||||
|
|||||||
@@ -345,10 +345,15 @@ public class AppView extends Activity implements AdapterFragmentCallbacks {
|
|||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
// Only add an option to create shortcut if box art is loaded
|
// Only add an option to create shortcut if box art is loaded
|
||||||
|
// and when we're in grid-mode (not list-mode).
|
||||||
ImageView appImageView = info.targetView.findViewById(R.id.grid_image);
|
ImageView appImageView = info.targetView.findViewById(R.id.grid_image);
|
||||||
BitmapDrawable drawable = (BitmapDrawable)appImageView.getDrawable();
|
if (appImageView != null) {
|
||||||
if (drawable != null && drawable.getBitmap() != null) {
|
// We have a grid ImageView, so we must be in grid-mode
|
||||||
menu.add(Menu.NONE, CREATE_SHORTCUT_ID, 4, getResources().getString(R.string.applist_menu_scut));
|
BitmapDrawable drawable = (BitmapDrawable)appImageView.getDrawable();
|
||||||
|
if (drawable != null && drawable.getBitmap() != null) {
|
||||||
|
// We have a bitmap loaded too
|
||||||
|
menu.add(Menu.NONE, CREATE_SHORTCUT_ID, 4, getResources().getString(R.string.applist_menu_scut));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
private boolean grabbedInput = true;
|
private boolean grabbedInput = true;
|
||||||
private boolean grabComboDown = false;
|
private boolean grabComboDown = false;
|
||||||
private StreamView streamView;
|
private StreamView streamView;
|
||||||
|
private boolean gotBackPointerEvent = false;
|
||||||
|
private boolean syntheticBackDown = false;
|
||||||
|
|
||||||
private ShortcutHelper shortcutHelper;
|
private ShortcutHelper shortcutHelper;
|
||||||
|
|
||||||
@@ -839,7 +841,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
if ((event.getSource() == InputDevice.SOURCE_MOUSE ||
|
if ((event.getSource() == InputDevice.SOURCE_MOUSE ||
|
||||||
event.getSource() == InputDevice.SOURCE_MOUSE_RELATIVE) &&
|
event.getSource() == InputDevice.SOURCE_MOUSE_RELATIVE) &&
|
||||||
event.getKeyCode() == KeyEvent.KEYCODE_BACK &&
|
event.getKeyCode() == KeyEvent.KEYCODE_BACK &&
|
||||||
event.getRepeatCount() == 0) {
|
event.getRepeatCount() == 0 &&
|
||||||
|
!gotBackPointerEvent) {
|
||||||
|
syntheticBackDown = true;
|
||||||
conn.sendMouseButtonDown(MouseButtonPacket.BUTTON_RIGHT);
|
conn.sendMouseButtonDown(MouseButtonPacket.BUTTON_RIGHT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -891,7 +895,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
// create as a result of a right-click.
|
// create as a result of a right-click.
|
||||||
if ((event.getSource() == InputDevice.SOURCE_MOUSE ||
|
if ((event.getSource() == InputDevice.SOURCE_MOUSE ||
|
||||||
event.getSource() == InputDevice.SOURCE_MOUSE_RELATIVE) &&
|
event.getSource() == InputDevice.SOURCE_MOUSE_RELATIVE) &&
|
||||||
event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
|
event.getKeyCode() == KeyEvent.KEYCODE_BACK &&
|
||||||
|
(!gotBackPointerEvent || syntheticBackDown)) {
|
||||||
|
// We need to raise the button if gotBackPointerEvent is true
|
||||||
|
// in the case where it transitioned to true after we already
|
||||||
|
// sent the right click down event.
|
||||||
|
syntheticBackDown = false;
|
||||||
conn.sendMouseButtonUp(MouseButtonPacket.BUTTON_RIGHT);
|
conn.sendMouseButtonUp(MouseButtonPacket.BUTTON_RIGHT);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -999,6 +1008,11 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
else {
|
else {
|
||||||
conn.sendMouseButtonUp(MouseButtonPacket.BUTTON_RIGHT);
|
conn.sendMouseButtonUp(MouseButtonPacket.BUTTON_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't use the KEYCODE_BACK hack (which interferes with mice
|
||||||
|
// with actual back buttons) since we're getting right clicks
|
||||||
|
// using this callback.
|
||||||
|
gotBackPointerEvent = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((changedButtons & MotionEvent.BUTTON_TERTIARY) != 0) {
|
if ((changedButtons & MotionEvent.BUTTON_TERTIARY) != 0) {
|
||||||
@@ -1010,6 +1024,28 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((changedButtons & MotionEvent.BUTTON_BACK) != 0) {
|
||||||
|
if ((event.getButtonState() & MotionEvent.BUTTON_BACK) != 0) {
|
||||||
|
conn.sendMouseButtonDown(MouseButtonPacket.BUTTON_X1);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
conn.sendMouseButtonUp(MouseButtonPacket.BUTTON_X1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't use the KEYCODE_BACK hack. That will cause this
|
||||||
|
// button press to trigger a right-click.
|
||||||
|
gotBackPointerEvent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((changedButtons & MotionEvent.BUTTON_FORWARD) != 0) {
|
||||||
|
if ((event.getButtonState() & MotionEvent.BUTTON_FORWARD) != 0) {
|
||||||
|
conn.sendMouseButtonDown(MouseButtonPacket.BUTTON_X2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
conn.sendMouseButtonUp(MouseButtonPacket.BUTTON_X2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Get relative axis values if we can
|
// Get relative axis values if we can
|
||||||
if (inputCaptureProvider.eventHasRelativeMouseAxes(event)) {
|
if (inputCaptureProvider.eventHasRelativeMouseAxes(event)) {
|
||||||
// Send the deltas straight from the motion event
|
// Send the deltas straight from the motion event
|
||||||
@@ -1360,6 +1396,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
|||||||
case EvdevListener.BUTTON_RIGHT:
|
case EvdevListener.BUTTON_RIGHT:
|
||||||
buttonIndex = MouseButtonPacket.BUTTON_RIGHT;
|
buttonIndex = MouseButtonPacket.BUTTON_RIGHT;
|
||||||
break;
|
break;
|
||||||
|
case EvdevListener.BUTTON_X1:
|
||||||
|
buttonIndex = MouseButtonPacket.BUTTON_X1;
|
||||||
|
break;
|
||||||
|
case EvdevListener.BUTTON_X2:
|
||||||
|
buttonIndex = MouseButtonPacket.BUTTON_X2;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
LimeLog.warning("Unhandled button: "+buttonId);
|
LimeLog.warning("Unhandled button: "+buttonId);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ public interface EvdevListener {
|
|||||||
int BUTTON_LEFT = 1;
|
int BUTTON_LEFT = 1;
|
||||||
int BUTTON_MIDDLE = 2;
|
int BUTTON_MIDDLE = 2;
|
||||||
int BUTTON_RIGHT = 3;
|
int BUTTON_RIGHT = 3;
|
||||||
|
int BUTTON_X1 = 4;
|
||||||
|
int BUTTON_X2 = 5;
|
||||||
|
|
||||||
void mouseMove(int deltaX, int deltaY);
|
void mouseMove(int deltaX, int deltaY);
|
||||||
void mouseButtonEvent(int buttonId, boolean down);
|
void mouseButtonEvent(int buttonId, boolean down);
|
||||||
|
|||||||
@@ -62,9 +62,8 @@ public class StreamView extends SurfaceView {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
|
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
|
||||||
// This callbacks allows us to override dumb IME behavior like when
|
// This callbacks allows us to override dumb IME behavior like when
|
||||||
// Samsung's default keyboard consumes Shift+Space. We'll process
|
// Samsung's default keyboard consumes Shift+Space.
|
||||||
// the input event directly if any modifier keys are down.
|
if (inputCallbacks != null) {
|
||||||
if (inputCallbacks != null && event.getModifiers() != 0) {
|
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
if (inputCallbacks.handleKeyDown(event)) {
|
if (inputCallbacks.handleKeyDown(event)) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -151,7 +151,15 @@ public class EvdevCaptureProvider extends InputCaptureProvider {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EvdevEvent.BTN_SIDE:
|
case EvdevEvent.BTN_SIDE:
|
||||||
|
listener.mouseButtonEvent(EvdevListener.BUTTON_X1,
|
||||||
|
event.value != 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case EvdevEvent.BTN_EXTRA:
|
case EvdevEvent.BTN_EXTRA:
|
||||||
|
listener.mouseButtonEvent(EvdevListener.BUTTON_X2,
|
||||||
|
event.value != 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case EvdevEvent.BTN_FORWARD:
|
case EvdevEvent.BTN_FORWARD:
|
||||||
case EvdevEvent.BTN_BACK:
|
case EvdevEvent.BTN_BACK:
|
||||||
case EvdevEvent.BTN_TASK:
|
case EvdevEvent.BTN_TASK:
|
||||||
|
|||||||
+1
-1
Submodule moonlight-common updated: 643d4b3c91...31d6b4cb9f.
Reference in new issue
Block a user