mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-10 10:20:32 -07:00
Merge branch 'master' of https://github.com/2009scape/2009scape-mobile
This commit is contained in:
commit
5b72e87a89
4 changed files with 115 additions and 136 deletions
|
|
@ -220,30 +220,14 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
public void onSurfaceTextureUpdated(@NonNull SurfaceTexture surface) {}
|
public void onSurfaceTextureUpdated(@NonNull SurfaceTexture surface) {}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.longPressDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
|
longPressDetector = new GestureDetector(getContext(), new GestureDetector.SimpleOnGestureListener() {
|
||||||
|
|
||||||
boolean isDragClicking = false;
|
|
||||||
@Override
|
@Override
|
||||||
public void onLongPress(MotionEvent e) {
|
public void onLongPress(MotionEvent e) {
|
||||||
super.onLongPress(e);
|
super.onLongPress(e);
|
||||||
if(!isDragClicking) {
|
CallbackBridge.putMouseEventWithCoords(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_RIGHT, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||||
isDragClicking = true;
|
|
||||||
AWTInputBridge.sendKey((char) AWTInputEvent.VK_F5, AWTInputEvent.VK_F5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onSingleTapUp(MotionEvent e) {
|
|
||||||
if(isDragClicking) {
|
|
||||||
isDragClicking = false;
|
|
||||||
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F5, AWTInputEvent.VK_F5);
|
|
||||||
}
|
|
||||||
return super.onSingleTapUp(e);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//this.longPressDetector.setIsLongpressEnabled(true);
|
|
||||||
|
|
||||||
((ViewGroup)getParent()).addView(textureView);
|
((ViewGroup)getParent()).addView(textureView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -257,7 +241,7 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
@SuppressWarnings("accessibility")
|
@SuppressWarnings("accessibility")
|
||||||
public boolean onTouchEvent(MotionEvent e) {
|
public boolean onTouchEvent(MotionEvent e) {
|
||||||
scaleGestureDetector.onTouchEvent(e);
|
scaleGestureDetector.onTouchEvent(e);
|
||||||
//longPressDetector.onTouchEvent(e);
|
longPressDetector.onTouchEvent(e);
|
||||||
// Kinda need to send this back to the layout
|
// Kinda need to send this back to the layout
|
||||||
if(((ControlLayout)getParent()).getModifiable()) return false;
|
if(((ControlLayout)getParent()).getModifiable()) return false;
|
||||||
|
|
||||||
|
|
@ -280,7 +264,6 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
CallbackBridge.mouseY = (e.getY() * mScaleFactor);
|
CallbackBridge.mouseY = (e.getY() * mScaleFactor);
|
||||||
//One android click = one MC click
|
//One android click = one MC click
|
||||||
if(mSingleTapDetector.onTouchEvent(e)){ //
|
if(mSingleTapDetector.onTouchEvent(e)){ //
|
||||||
//longPressDetector.onTouchEvent(e);// Touch Mode
|
|
||||||
CallbackBridge.putMouseEventWithCoords(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_LEFT, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
CallbackBridge.putMouseEventWithCoords(LwjglGlfwKeycode.GLFW_MOUSE_BUTTON_LEFT, CallbackBridge.mouseX, CallbackBridge.mouseY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -429,6 +412,7 @@ public class GLFWGLSurface extends View implements GrabListener {
|
||||||
|
|
||||||
// Actualise the pointer count
|
// Actualise the pointer count
|
||||||
mLastPointerCount = e.getPointerCount();
|
mLastPointerCount = e.getPointerCount();
|
||||||
|
longPressDetector.onTouchEvent(e);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package net.kdt.pojavlaunch;
|
||||||
import static net.kdt.pojavlaunch.MainActivity.fullyExit;
|
import static net.kdt.pojavlaunch.MainActivity.fullyExit;
|
||||||
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
import static net.kdt.pojavlaunch.Tools.currentDisplayMetrics;
|
||||||
|
|
||||||
|
import static java.security.AccessController.getContext;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
|
@ -48,7 +50,10 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
private LinearLayout mTouchPad;
|
private LinearLayout mTouchPad;
|
||||||
private ImageView mMousePointerImageView;
|
private ImageView mMousePointerImageView;
|
||||||
private GestureDetector mGestureDetector;
|
private GestureDetector mGestureDetector;
|
||||||
|
|
||||||
|
private GestureDetector longPressDetector;
|
||||||
private boolean cameraMode = false;
|
private boolean cameraMode = false;
|
||||||
|
float prevX = 0, prevY = 0;
|
||||||
private long lastPress = 0;
|
private long lastPress = 0;
|
||||||
private ScaleGestureDetector scaleGestureDetector;
|
private ScaleGestureDetector scaleGestureDetector;
|
||||||
private boolean rcState = false;
|
private boolean rcState = false;
|
||||||
|
|
@ -91,10 +96,11 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
ViewGroup.LayoutParams params = mMousePointerImageView.getLayoutParams();
|
ViewGroup.LayoutParams params = mMousePointerImageView.getLayoutParams();
|
||||||
params.width = (int) (36 / 100f * LauncherPreferences.PREF_MOUSESCALE);
|
params.width = (int) (36 / 100f * LauncherPreferences.PREF_MOUSESCALE);
|
||||||
params.height = (int) (54 / 100f * LauncherPreferences.PREF_MOUSESCALE);
|
params.height = (int) (54 / 100f * LauncherPreferences.PREF_MOUSESCALE);
|
||||||
|
if(LauncherPreferences.PREF_VIRTUAL_MOUSE_START)
|
||||||
|
toggleVirtualMouse();
|
||||||
});
|
});
|
||||||
|
|
||||||
mTouchPad.setOnTouchListener(new View.OnTouchListener() {
|
mTouchPad.setOnTouchListener(new View.OnTouchListener() {
|
||||||
float prevX = 0, prevY = 0;
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onTouch(View v, MotionEvent event) {
|
public boolean onTouch(View v, MotionEvent event) {
|
||||||
// MotionEvent reports input details from the touch screen
|
// MotionEvent reports input details from the touch screen
|
||||||
|
|
@ -120,8 +126,8 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (action == MotionEvent.ACTION_MOVE) { // 2
|
if (action == MotionEvent.ACTION_MOVE) { // 2
|
||||||
mouseX = Math.max(0, Math.min(currentDisplayMetrics.widthPixels, mouseX + (x - prevX) * LauncherPreferences.PREF_MOUSESPEED));
|
mouseX = Math.max(0, Math.min(currentDisplayMetrics.widthPixels, mouseX + (x - prevX) * mouseSpeed));
|
||||||
mouseY = Math.max(0, Math.min(currentDisplayMetrics.heightPixels, mouseY + (y - prevY) * LauncherPreferences.PREF_MOUSESPEED));
|
mouseY = Math.max(0, Math.min(currentDisplayMetrics.heightPixels, mouseY + (y - prevY) * mouseSpeed));
|
||||||
placeMouseAt(mouseX, mouseY);
|
placeMouseAt(mouseX, mouseY);
|
||||||
sendScaledMousePosition(mouseX, mouseY);
|
sendScaledMousePosition(mouseX, mouseY);
|
||||||
}
|
}
|
||||||
|
|
@ -130,8 +136,6 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
if (event.getPointerCount() == 2) {
|
if (event.getPointerCount() == 2) {
|
||||||
// Right-click event when a second finger touches the screen
|
// Right-click event when a second finger touches the screen
|
||||||
// Simulating right-click by sending GLFW_MOUSE_BUTTON_RIGHT event
|
// Simulating right-click by sending GLFW_MOUSE_BUTTON_RIGHT event
|
||||||
Log.i("downthecrop","Hi from a rightclick event!");
|
|
||||||
//activateRC();
|
|
||||||
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F11,AWTInputEvent.VK_F11);
|
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F11,AWTInputEvent.VK_F11);
|
||||||
AWTInputBridge.sendMousePress(AWTInputEvent.BUTTON1_DOWN_MASK);
|
AWTInputBridge.sendMousePress(AWTInputEvent.BUTTON1_DOWN_MASK);
|
||||||
}
|
}
|
||||||
|
|
@ -146,6 +150,7 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
|
|
||||||
mTextureView.setOnTouchListener((v, event) -> {
|
mTextureView.setOnTouchListener((v, event) -> {
|
||||||
scaleGestureDetector.onTouchEvent(event);
|
scaleGestureDetector.onTouchEvent(event);
|
||||||
|
longPressDetector.onTouchEvent(event);
|
||||||
float x = event.getX();
|
float x = event.getX();
|
||||||
float y = event.getY();
|
float y = event.getY();
|
||||||
if (mGestureDetector.onTouchEvent(event)) {
|
if (mGestureDetector.onTouchEvent(event)) {
|
||||||
|
|
@ -164,11 +169,34 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
break;
|
break;
|
||||||
case MotionEvent.ACTION_MOVE: // 2
|
case MotionEvent.ACTION_MOVE: // 2
|
||||||
sendScaledMousePosition(x + mTextureView.getX(), y);
|
sendScaledMousePosition(x + mTextureView.getX(), y);
|
||||||
|
try {
|
||||||
|
panCamera(prevX-x, prevY-y);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
prevY = y;
|
||||||
|
prevX = x;
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
longPressDetector = new GestureDetector(this, new GestureDetector.SimpleOnGestureListener() {
|
||||||
|
@Override
|
||||||
|
public void onLongPress(MotionEvent e) {
|
||||||
|
// Send RightClick
|
||||||
|
AWTInputBridge.sendKey((char)AWTInputEvent.VK_F11,AWTInputEvent.VK_F11);
|
||||||
|
AWTInputBridge.sendMousePress(AWTInputEvent.BUTTON1_DOWN_MASK);
|
||||||
|
super.onLongPress(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onSingleTapUp(MotionEvent e) {
|
||||||
|
return super.onSingleTapUp(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
placeMouseAt(CallbackBridge.physicalWidth / 2f, CallbackBridge.physicalHeight / 2f);
|
placeMouseAt(CallbackBridge.physicalWidth / 2f, CallbackBridge.physicalHeight / 2f);
|
||||||
|
|
@ -203,14 +231,28 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
} catch (Throwable th) {
|
} catch (Throwable th) {
|
||||||
Tools.showError(this, th, true);
|
Tools.showError(this, th, true);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void panCamera(float dx, float dy) throws InterruptedException {
|
||||||
|
//Log.i("downthecrop-pan","dx: " +dx + " dy: " + dy);
|
||||||
|
final float threshold = 8.0f; // adjust this value as needed to control the sensitivity of the panning
|
||||||
|
|
||||||
getOnBackPressedDispatcher().addCallback(new OnBackPressedCallback(true) {
|
// Check horizontal panning
|
||||||
@Override
|
if(dx > threshold) {
|
||||||
public void handleOnBackPressed() {
|
// Finger moved to the right, pan camera to the right
|
||||||
MainActivity.dialogForceClose(JavaGUILauncherActivity.this);
|
AWTInputBridge.sendKey((char)AWTInputEvent.VK_RIGHT, AWTInputEvent.VK_RIGHT);
|
||||||
}
|
} else if(dx < -threshold) {
|
||||||
});
|
AWTInputBridge.sendKey((char)AWTInputEvent.VK_LEFT, AWTInputEvent.VK_LEFT);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check vertical panning
|
||||||
|
if(dy > threshold) {
|
||||||
|
// Finger moved down, pan camera up
|
||||||
|
AWTInputBridge.sendKey((char)AWTInputEvent.VK_UP, AWTInputEvent.VK_UP);
|
||||||
|
} else if(dy < -threshold) {
|
||||||
|
// Finger moved up, pan camera down
|
||||||
|
AWTInputBridge.sendKey((char)AWTInputEvent.VK_DOWN, AWTInputEvent.VK_DOWN);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -261,7 +303,6 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
break;
|
break;
|
||||||
case R.id.camera:
|
case R.id.camera:
|
||||||
if (!cameraMode) { // Camera Mode On
|
if (!cameraMode) { // Camera Mode On
|
||||||
Log.i("downthecrop", "Hello from the camrea Button");
|
|
||||||
AWTInputBridge.sendKey((char) AWTInputEvent.VK_F9, AWTInputEvent.VK_F9); // Send F9
|
AWTInputBridge.sendKey((char) AWTInputEvent.VK_F9, AWTInputEvent.VK_F9); // Send F9
|
||||||
cameraMode = true;
|
cameraMode = true;
|
||||||
findViewById(R.id.camera).setBackground(getResources().getDrawable( R.drawable.control_button_pressed ));
|
findViewById(R.id.camera).setBackground(getResources().getDrawable( R.drawable.control_button_pressed ));
|
||||||
|
|
@ -272,7 +313,7 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.mouseMode:
|
case R.id.mouseMode:
|
||||||
toggleVirtualMouse(this.getCurrentFocus());
|
toggleVirtualMouse();
|
||||||
}
|
}
|
||||||
lastPress = time;
|
lastPress = time;
|
||||||
}
|
}
|
||||||
|
|
@ -320,7 +361,7 @@ public class JavaGUILauncherActivity extends BaseActivity implements View.OnTouc
|
||||||
mLoggerView.setVisibility(View.VISIBLE);
|
mLoggerView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void toggleVirtualMouse(View v) {
|
public void toggleVirtualMouse() {
|
||||||
mIsVirtualMouseEnabled = !mIsVirtualMouseEnabled;
|
mIsVirtualMouseEnabled = !mIsVirtualMouseEnabled;
|
||||||
ImageView view = findViewById(R.id.mouseModeIco);
|
ImageView view = findViewById(R.id.mouseModeIco);
|
||||||
if(!mIsVirtualMouseEnabled){
|
if(!mIsVirtualMouseEnabled){
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import net.kdt.pojavlaunch.utils.KeyEncoder;
|
||||||
*/
|
*/
|
||||||
public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText {
|
public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText {
|
||||||
public static final String TEXT_FILLER = " ";
|
public static final String TEXT_FILLER = " ";
|
||||||
|
public static boolean softKeyboardIsActive = false;
|
||||||
public TouchCharInput(@NonNull Context context) {
|
public TouchCharInput(@NonNull Context context) {
|
||||||
this(context, null);
|
this(context, null);
|
||||||
}
|
}
|
||||||
|
|
@ -49,7 +50,7 @@ public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText
|
||||||
Log.i("TouchCharInput","New Event (before/after)!: "+ lengthBefore + " : " + lengthAfter);
|
Log.i("TouchCharInput","New Event (before/after)!: "+ lengthBefore + " : " + lengthAfter);
|
||||||
boolean isBackSpace = (lengthBefore > lengthAfter);
|
boolean isBackSpace = (lengthBefore > lengthAfter);
|
||||||
if(isBackSpace) {
|
if(isBackSpace) {
|
||||||
KeyEncoder.sendEncodedChar(KeyEncoder.backspaceUnicode,KeyEncoder.backspaceUnicode);
|
KeyEncoder.sendUnicodeBackspace();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char c = text.charAt(text.length()-1);
|
char c = text.charAt(text.length()-1);
|
||||||
|
|
@ -115,6 +116,7 @@ public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText
|
||||||
|
|
||||||
/** Regain ability to exist, take focus and have some text being input */
|
/** Regain ability to exist, take focus and have some text being input */
|
||||||
public void enable(){
|
public void enable(){
|
||||||
|
softKeyboardIsActive = true;
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
setVisibility(VISIBLE);
|
setVisibility(VISIBLE);
|
||||||
|
|
@ -123,6 +125,7 @@ public class TouchCharInput extends androidx.appcompat.widget.AppCompatEditText
|
||||||
|
|
||||||
/** Lose ability to exist, take focus and have some text being input */
|
/** Lose ability to exist, take focus and have some text being input */
|
||||||
public void disable(){
|
public void disable(){
|
||||||
|
softKeyboardIsActive = false;
|
||||||
clear();
|
clear();
|
||||||
setVisibility(GONE);
|
setVisibility(GONE);
|
||||||
clearFocus();
|
clearFocus();
|
||||||
|
|
|
||||||
|
|
@ -1,112 +1,63 @@
|
||||||
package net.kdt.pojavlaunch.utils;
|
package net.kdt.pojavlaunch.utils;
|
||||||
|
|
||||||
import net.kdt.pojavlaunch.AWTInputBridge;
|
import net.kdt.pojavlaunch.AWTInputBridge;
|
||||||
|
import net.kdt.pojavlaunch.customcontrols.keyboard.TouchCharInput;
|
||||||
|
|
||||||
/*
|
import java.util.HashMap;
|
||||||
About Key Events. Because the Android Spec doesn't require
|
import java.util.Map;
|
||||||
soft keyboards to dispatch key events not all keyboard implementations
|
|
||||||
across Android will trigger these actions.
|
|
||||||
|
|
||||||
Currently we use the following function to translate keycodes for
|
|
||||||
special character, capital letters, and digits.
|
|
||||||
|
|
||||||
keycode 123 (F12) is used as a single digit capslock button which
|
|
||||||
when sent to the miniclient before a char will act accordingly.
|
|
||||||
*/
|
|
||||||
|
|
||||||
public class KeyEncoder {
|
public class KeyEncoder {
|
||||||
|
|
||||||
static String specialChars = "/*!@#$%^&*()\"{}_[+:;=-_]'|\\?/<>,.";
|
private static final Map<Character, Character> specialCharMap = createSpecialCharMap();
|
||||||
static char modifier = 123;
|
private static final char MODIFIER = 123; // F12 key as a modifier for caps lock
|
||||||
static char backspaceAndroid = 67;
|
private static final char BACKSPACE_ANDROID = 67;
|
||||||
public static char backspaceUnicode = 8;
|
private static final char BACKSPACE_UNICODE = 8;
|
||||||
|
|
||||||
public static void sendEncodedChar(int keyCode, char iC){
|
// Initialize the mapping of special characters to their respective keys
|
||||||
System.out.println(keyCode);
|
private static Map<Character, Character> createSpecialCharMap() {
|
||||||
if(keyCode == 75)
|
Map<Character, Character> map = new HashMap<>();
|
||||||
AWTInputBridge.sendKey((char)222,222);
|
map.put('!', '1');
|
||||||
else if(keyCode == backspaceAndroid){
|
map.put('@', '2');
|
||||||
AWTInputBridge.sendKey(backspaceUnicode,backspaceUnicode);
|
map.put('#', '3');
|
||||||
} else if(specialChars.contains(""+iC)){
|
map.put('$', '4');
|
||||||
// Send special character to client
|
map.put('%', '5');
|
||||||
char c = iC;
|
map.put('^', '6');
|
||||||
switch(c){
|
map.put('&', '7');
|
||||||
case '!':
|
map.put('*', '8');
|
||||||
c = '1';
|
map.put('(', '9');
|
||||||
break;
|
map.put(')', '0');
|
||||||
case '@':
|
map.put('_', '-');
|
||||||
c = '2';
|
map.put('+', '=');
|
||||||
break;
|
map.put('{', '[');
|
||||||
case '#':
|
map.put('}', ']');
|
||||||
c = '3';
|
map.put(':', ';');
|
||||||
break;
|
map.put('"', '\'');
|
||||||
case '$':
|
map.put('<', ',');
|
||||||
c = '4';
|
map.put('>', '.');
|
||||||
break;
|
map.put('?', '/');
|
||||||
case '%':
|
map.put('|', '\\');
|
||||||
c = '5';
|
return map;
|
||||||
break;
|
}
|
||||||
case '^':
|
|
||||||
c = '6';
|
public static void sendUnicodeBackspace(){
|
||||||
break;
|
AWTInputBridge.sendKey(BACKSPACE_UNICODE, BACKSPACE_UNICODE);
|
||||||
case '&':
|
}
|
||||||
c = '7';
|
|
||||||
break;
|
public static void sendEncodedChar(int keyCode, char c) {
|
||||||
case '*':
|
if (keyCode == BACKSPACE_ANDROID && !TouchCharInput.softKeyboardIsActive) {
|
||||||
c = '8';
|
sendUnicodeBackspace();
|
||||||
break;
|
} else if (specialCharMap.containsKey(c)) {
|
||||||
case '(':
|
AWTInputBridge.sendKey(MODIFIER, MODIFIER);
|
||||||
c = '9';
|
AWTInputBridge.sendKey(specialCharMap.get(c), specialCharMap.get(c));
|
||||||
break;
|
} else if (Character.isDigit(c)) {
|
||||||
case ')':
|
AWTInputBridge.sendKey(c, c);
|
||||||
c = '0';
|
} else if (Character.isLowerCase(c)){
|
||||||
break;
|
AWTInputBridge.sendKey(Character.toUpperCase(c),Character.toUpperCase(c));
|
||||||
case '_':
|
} else if (Character.isUpperCase(c)) {
|
||||||
c = '-';
|
AWTInputBridge.sendKey(MODIFIER, MODIFIER);
|
||||||
break;
|
AWTInputBridge.sendKey(c, c);
|
||||||
case '+':
|
|
||||||
c = '=';
|
|
||||||
break;
|
|
||||||
case '{':
|
|
||||||
c = '[';
|
|
||||||
break;
|
|
||||||
case '}':
|
|
||||||
c = ']';
|
|
||||||
break;
|
|
||||||
case ':':
|
|
||||||
c = ';';
|
|
||||||
break;
|
|
||||||
case '"':
|
|
||||||
c = '\'';
|
|
||||||
break;
|
|
||||||
case '<':
|
|
||||||
c = ',';
|
|
||||||
break;
|
|
||||||
case '>':
|
|
||||||
c = '.';
|
|
||||||
break;
|
|
||||||
case '?':
|
|
||||||
c = '/';
|
|
||||||
break;
|
|
||||||
case '|':
|
|
||||||
c = '\\';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if(c != iC){
|
|
||||||
AWTInputBridge.sendKey(modifier,modifier);
|
|
||||||
}
|
|
||||||
AWTInputBridge.sendKey(c,c);
|
|
||||||
} else if(Character.isDigit(iC)){
|
|
||||||
AWTInputBridge.sendKey(iC,iC);
|
|
||||||
} else if (iC == Character.toUpperCase(iC)){
|
|
||||||
// We send F12 as a modifier to avoid needing to worry about shift.
|
|
||||||
// Client takes this modifier and does a toUpperCase().
|
|
||||||
AWTInputBridge.sendKey(modifier,modifier);
|
|
||||||
AWTInputBridge.sendKey(Character.toUpperCase(iC),Character.toUpperCase(iC));
|
|
||||||
} else if(iC == Character.toLowerCase(iC)){
|
|
||||||
AWTInputBridge.sendKey(Character.toUpperCase(iC),Character.toUpperCase(iC));
|
|
||||||
} else {
|
} else {
|
||||||
AWTInputBridge.sendKey(iC,keyCode);
|
AWTInputBridge.sendKey(c, keyCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue