FreeRDP
Loading...
Searching...
No Matches
com.freerdp.freerdpcore.presentation.SessionInputManager Class Reference
Inheritance diagram for com.freerdp.freerdpcore.presentation.SessionInputManager:
Collaboration diagram for com.freerdp.freerdpcore.presentation.SessionInputManager:

Public Member Functions

 SessionInputManager (Context context, ScrollView2D scrollView, SessionView sessionView, TouchPointerView touchPointerView, KeyboardView keyboardView, KeyboardView modifiersKeyboardView)
 
void attachSession (long instance, Bitmap surface)
 
void setBitmap (Bitmap bitmap)
 
ScaleGestureDetector.OnScaleGestureListener getPinchZoomListener ()
 
void setScreenSize (int width, int height)
 
void reloadKeyboards ()
 
void toggleSystemKeyboard ()
 
void toggleExtendedKeyboard ()
 
void hideKeyboards ()
 
boolean isAnyKeyboardVisible ()
 
void cancelPendingEvents ()
 
boolean onGenericMotionEvent (MotionEvent e)
 
boolean onAndroidKeyEvent (KeyEvent event)
 
boolean onAndroidKeyLongPress (int keyCode)
 
boolean handleBackAsAltF4 ()
 
void toggleTouchPointer ()
 
void onSessionViewBeginTouch ()
 
void onSessionViewEndTouch ()
 
void onSessionViewLeftTouch (int x, int y, boolean down)
 
void onSessionViewMiddleTouch (int x, int y, boolean down)
 
void onSessionViewRightTouch (int x, int y, boolean down)
 
void onSessionViewMove (int x, int y)
 
void onSessionViewMouseMove (int x, int y)
 
void onSessionViewScroll (boolean down)
 
void onSessionViewHScroll (boolean right)
 
void onTouchPointerClose ()
 
void onTouchPointerLeftClick (int x, int y, boolean down)
 
void onTouchPointerRightClick (int x, int y, boolean down)
 
void onTouchPointerMove (int x, int y)
 
void onTouchPointerScroll (boolean down)
 
void onTouchPointerToggleKeyboard ()
 
void onTouchPointerToggleExtKeyboard ()
 
void onTouchPointerResetScrollZoom ()
 
void processVirtualKey (int virtualKeyCode, boolean down)
 
void processUnicodeKey (int unicodeKey)
 
void switchKeyboard (int keyboardType)
 
void modifiersChanged ()
 
void onKey (int primaryCode, int[] keyCodes)
 
void onText (CharSequence text)
 
void swipeRight ()
 
void swipeLeft ()
 
void swipeDown ()
 
void swipeUp ()
 
void onPress (int primaryCode)
 
void onRelease (int primaryCode)
 

Detailed Description

Definition at line 30 of file SessionInputManager.java.

Constructor & Destructor Documentation

◆ SessionInputManager()

com.freerdp.freerdpcore.presentation.SessionInputManager.SessionInputManager ( Context  context,
ScrollView2D  scrollView,
SessionView  sessionView,
TouchPointerView  touchPointerView,
KeyboardView  keyboardView,
KeyboardView  modifiersKeyboardView 
)
inline

Definition at line 71 of file SessionInputManager.java.

74 {
75 this.context = context;
76 this.scrollView = scrollView;
77 this.sessionView = sessionView;
78 this.touchPointerView = touchPointerView;
79 this.keyboardView = keyboardView;
80 this.modifiersKeyboardView = modifiersKeyboardView;
81 this.handler = new InputHandler();
82
83 this.keyboardMapper = new KeyboardMapper();
84 this.keyboardMapper.init(context);
85
86 loadKeyboards();
87 keyboardView.setKeyboard(specialkeysKeyboard);
88 modifiersKeyboardView.setKeyboard(modifiersKeyboard);
89
90 keyboardView.setOnKeyboardActionListener(this);
91 modifiersKeyboardView.setOnKeyboardActionListener(this);
92 }

Member Function Documentation

◆ attachSession()

void com.freerdp.freerdpcore.presentation.SessionInputManager.attachSession ( long  instance,
Bitmap  surface 
)
inline

Definition at line 104 of file SessionInputManager.java.

105 {
106 this.instance = instance;
107 this.bitmap = surface;
108 keyboardMapper.reset(this);
109 }

◆ cancelPendingEvents()

void com.freerdp.freerdpcore.presentation.SessionInputManager.cancelPendingEvents ( )
inline

Definition at line 218 of file SessionInputManager.java.

219 {
220 handler.removeMessages(MSG_SEND_MOVE_EVENT);
221 }

◆ getPinchZoomListener()

ScaleGestureDetector.OnScaleGestureListener com.freerdp.freerdpcore.presentation.SessionInputManager.getPinchZoomListener ( )
inline

Definition at line 118 of file SessionInputManager.java.

119 {
120 return pinchZoomListener;
121 }

◆ handleBackAsAltF4()

boolean com.freerdp.freerdpcore.presentation.SessionInputManager.handleBackAsAltF4 ( )
inline

Definition at line 262 of file SessionInputManager.java.

263 {
264 if (instance == 0)
265 return false;
266 if (!ApplicationSettingsActivity.getUseBackAsAltf4(context))
267 return false;
268 keyboardMapper.sendAltF4();
269 return true;
270 }

◆ hideKeyboards()

void com.freerdp.freerdpcore.presentation.SessionInputManager.hideKeyboards ( )
inline

Definition at line 152 of file SessionInputManager.java.

153 {
154 showKeyboard(false, false);
155 }

◆ isAnyKeyboardVisible()

boolean com.freerdp.freerdpcore.presentation.SessionInputManager.isAnyKeyboardVisible ( )
inline

Definition at line 158 of file SessionInputManager.java.

159 {
160 return sysKeyboardVisible || extKeyboardVisible;
161 }

◆ modifiersChanged()

void com.freerdp.freerdpcore.presentation.SessionInputManager.modifiersChanged ( )
inline

Definition at line 522 of file SessionInputManager.java.

523 {
524 updateModifierKeyStates();
525 }

◆ onAndroidKeyEvent()

boolean com.freerdp.freerdpcore.presentation.SessionInputManager.onAndroidKeyEvent ( KeyEvent  event)
inline

Definition at line 240 of file SessionInputManager.java.

241 {
242 if (instance == 0)
243 return false;
244 return keyboardMapper.processAndroidKeyEvent(event);
245 }

◆ onAndroidKeyLongPress()

boolean com.freerdp.freerdpcore.presentation.SessionInputManager.onAndroidKeyLongPress ( int  keyCode)
inline

Definition at line 249 of file SessionInputManager.java.

250 {
251 if (instance == 0)
252 return false;
253 if (keyCode == KeyEvent.KEYCODE_BACK)
254 {
255 LibFreeRDP.disconnect(instance);
256 return true;
257 }
258 return false;
259 }

◆ onGenericMotionEvent()

boolean com.freerdp.freerdpcore.presentation.SessionInputManager.onGenericMotionEvent ( MotionEvent  e)
inline

Definition at line 224 of file SessionInputManager.java.

225 {
226 if (instance == 0)
227 return false;
228 if (e.getAction() != MotionEvent.ACTION_SCROLL)
229 return false;
230
231 final float vScroll = e.getAxisValue(MotionEvent.AXIS_VSCROLL);
232 if (vScroll < 0)
233 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, false));
234 else if (vScroll > 0)
235 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, true));
236 return true;
237 }

◆ onKey()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onKey ( int  primaryCode,
int[]  keyCodes 
)
inline

Definition at line 530 of file SessionInputManager.java.

531 {
532 keyboardMapper.processCustomKeyEvent(primaryCode);
533 }

◆ onPress()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onPress ( int  primaryCode)
inline

Definition at line 555 of file SessionInputManager.java.

556 {
557 }

◆ onRelease()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onRelease ( int  primaryCode)
inline

Definition at line 559 of file SessionInputManager.java.

560 {
561 }

◆ onSessionViewBeginTouch()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewBeginTouch ( )
inline

◆ onSessionViewEndTouch()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewEndTouch ( )
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 364 of file SessionInputManager.java.

365 {
366 scrollView.setScrollEnabled(true);
367 }

◆ onSessionViewHScroll()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewHScroll ( boolean  right)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 413 of file SessionInputManager.java.

414 {
415 if (instance == 0)
416 return;
417 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getHScrollEvent(context, right));
418 }

◆ onSessionViewLeftTouch()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewLeftTouch ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 369 of file SessionInputManager.java.

370 {
371 if (instance == 0)
372 return;
373 if (!down)
374 cancelDelayedMoveEvent();
375 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getLeftButtonEvent(context, down));
376 }

◆ onSessionViewMiddleTouch()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewMiddleTouch ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 378 of file SessionInputManager.java.

379 {
380 if (instance == 0)
381 return;
382 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getMiddleButtonEvent(down));
383 }

◆ onSessionViewMouseMove()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewMouseMove ( int  x,
int  y 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 399 of file SessionInputManager.java.

400 {
401 if (instance == 0)
402 return;
403 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getMoveEvent());
404 }

◆ onSessionViewMove()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewMove ( int  x,
int  y 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 392 of file SessionInputManager.java.

393 {
394 if (instance == 0)
395 return;
396 sendDelayedMoveEvent(x, y);
397 }

◆ onSessionViewRightTouch()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewRightTouch ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 385 of file SessionInputManager.java.

386 {
387 if (instance == 0)
388 return;
389 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getRightButtonEvent(context, down));
390 }

◆ onSessionViewScroll()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onSessionViewScroll ( boolean  down)
inline

Implements com.freerdp.freerdpcore.presentation.SessionView.SessionViewListener.

Definition at line 406 of file SessionInputManager.java.

407 {
408 if (instance == 0)
409 return;
410 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, down));
411 }

◆ onText()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onText ( CharSequence  text)
inline

Definition at line 535 of file SessionInputManager.java.

536 {
537 }

◆ onTouchPointerClose()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerClose ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 423 of file SessionInputManager.java.

424 {
425 touchPointerView.setVisibility(View.INVISIBLE);
426 sessionView.setTouchPointerPadding(0, 0);
427 }

◆ onTouchPointerLeftClick()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerLeftClick ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 429 of file SessionInputManager.java.

430 {
431 if (instance == 0)
432 return;
433 Point p = mapScreenCoordToSessionCoord(x, y);
434 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getLeftButtonEvent(context, down));
435 }

◆ onTouchPointerMove()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerMove ( int  x,
int  y 
)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 445 of file SessionInputManager.java.

446 {
447 if (instance == 0)
448 return;
449 Point p = mapScreenCoordToSessionCoord(x, y);
450 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getMoveEvent());
451
452 if (ApplicationSettingsActivity.getAutoScrollTouchPointer(context) &&
453 !handler.hasMessages(MSG_SCROLLING_REQUESTED))
454 {
455 Log.v(TAG, "Starting auto-scroll");
456 handler.sendEmptyMessageDelayed(MSG_SCROLLING_REQUESTED, SCROLLING_TIMEOUT);
457 }
458 }

◆ onTouchPointerResetScrollZoom()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerResetScrollZoom ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 477 of file SessionInputManager.java.

478 {
479 sessionView.setZoom(1.0f);
480 scrollView.scrollTo(0, 0);
481 }

◆ onTouchPointerRightClick()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerRightClick ( int  x,
int  y,
boolean  down 
)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 437 of file SessionInputManager.java.

438 {
439 if (instance == 0)
440 return;
441 Point p = mapScreenCoordToSessionCoord(x, y);
442 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getRightButtonEvent(context, down));
443 }

◆ onTouchPointerScroll()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerScroll ( boolean  down)
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 460 of file SessionInputManager.java.

461 {
462 if (instance == 0)
463 return;
464 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, down));
465 }

◆ onTouchPointerToggleExtKeyboard()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerToggleExtKeyboard ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 472 of file SessionInputManager.java.

473 {
474 toggleExtendedKeyboard();
475 }

◆ onTouchPointerToggleKeyboard()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerToggleKeyboard ( )
inline

Implements com.freerdp.freerdpcore.presentation.TouchPointerView.TouchPointerListener.

Definition at line 467 of file SessionInputManager.java.

468 {
469 toggleSystemKeyboard();
470 }

◆ processUnicodeKey()

void com.freerdp.freerdpcore.presentation.SessionInputManager.processUnicodeKey ( int  unicodeKey)
inline

Definition at line 493 of file SessionInputManager.java.

494 {
495 if (instance == 0)
496 return;
497 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, true);
498 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, false);
499 }

◆ processVirtualKey()

void com.freerdp.freerdpcore.presentation.SessionInputManager.processVirtualKey ( int  virtualKeyCode,
boolean  down 
)
inline

Definition at line 486 of file SessionInputManager.java.

487 {
488 if (instance == 0)
489 return;
490 LibFreeRDP.sendKeyEvent(instance, virtualKeyCode, down);
491 }

◆ reloadKeyboards()

void com.freerdp.freerdpcore.presentation.SessionInputManager.reloadKeyboards ( )
inline

Definition at line 132 of file SessionInputManager.java.

133 {
134 loadKeyboards();
135 keyboardView.setKeyboard(specialkeysKeyboard);
136 modifiersKeyboardView.setKeyboard(modifiersKeyboard);
137 }

◆ setBitmap()

void com.freerdp.freerdpcore.presentation.SessionInputManager.setBitmap ( Bitmap  bitmap)
inline

Definition at line 112 of file SessionInputManager.java.

113 {
114 this.bitmap = bitmap;
115 }

◆ setScreenSize()

void com.freerdp.freerdpcore.presentation.SessionInputManager.setScreenSize ( int  width,
int  height 
)
inline

Definition at line 124 of file SessionInputManager.java.

125 {
126 this.screenWidth = width;
127 this.screenHeight = height;
128 }

◆ swipeDown()

void com.freerdp.freerdpcore.presentation.SessionInputManager.swipeDown ( )
inline

Definition at line 547 of file SessionInputManager.java.

548 {
549 }

◆ swipeLeft()

void com.freerdp.freerdpcore.presentation.SessionInputManager.swipeLeft ( )
inline

Definition at line 543 of file SessionInputManager.java.

544 {
545 }

◆ swipeRight()

void com.freerdp.freerdpcore.presentation.SessionInputManager.swipeRight ( )
inline

Definition at line 539 of file SessionInputManager.java.

540 {
541 }

◆ swipeUp()

void com.freerdp.freerdpcore.presentation.SessionInputManager.swipeUp ( )
inline

Definition at line 551 of file SessionInputManager.java.

552 {
553 }

◆ switchKeyboard()

void com.freerdp.freerdpcore.presentation.SessionInputManager.switchKeyboard ( int  keyboardType)
inline

Definition at line 501 of file SessionInputManager.java.

502 {
503 switch (keyboardType)
504 {
505 case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS:
506 keyboardView.setKeyboard(specialkeysKeyboard);
507 break;
508
509 case KeyboardMapper.KEYBOARD_TYPE_NUMPAD:
510 keyboardView.setKeyboard(numpadKeyboard);
511 break;
512
513 case KeyboardMapper.KEYBOARD_TYPE_CURSOR:
514 keyboardView.setKeyboard(cursorKeyboard);
515 break;
516
517 default:
518 break;
519 }
520 }

◆ toggleExtendedKeyboard()

void com.freerdp.freerdpcore.presentation.SessionInputManager.toggleExtendedKeyboard ( )
inline

Definition at line 146 of file SessionInputManager.java.

147 {
148 showKeyboard(false, !extKeyboardVisible);
149 }

◆ toggleSystemKeyboard()

void com.freerdp.freerdpcore.presentation.SessionInputManager.toggleSystemKeyboard ( )
inline

Definition at line 140 of file SessionInputManager.java.

141 {
142 showKeyboard(!sysKeyboardVisible, false);
143 }

◆ toggleTouchPointer()

void com.freerdp.freerdpcore.presentation.SessionInputManager.toggleTouchPointer ( )
inline

Definition at line 273 of file SessionInputManager.java.

274 {
275 if (touchPointerView.getVisibility() == View.VISIBLE)
276 {
277 touchPointerView.setVisibility(View.INVISIBLE);
278 sessionView.setTouchPointerPadding(0, 0);
279 }
280 else
281 {
282 touchPointerView.setVisibility(View.VISIBLE);
283 sessionView.setTouchPointerPadding(touchPointerView.getPointerWidth(),
284 touchPointerView.getPointerHeight());
285 }
286 }

The documentation for this class was generated from the following file: