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

void setSafeInsets (int left, int top)
 
 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 onTouchPointerMoveEnd ()
 
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 35 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 86 of file SessionInputManager.java.

89 {
90 this.context = context;
91 this.scrollView = scrollView;
92 this.sessionView = sessionView;
93 this.touchPointerView = touchPointerView;
94 this.keyboardView = keyboardView;
95 this.modifiersKeyboardView = modifiersKeyboardView;
96 this.handler = new InputHandler();
97
98 this.keyboardMapper = new KeyboardMapper();
99 this.keyboardMapper.init(context);
100
101 loadKeyboards();
102 keyboardView.setKeyboard(specialkeysKeyboard);
103 modifiersKeyboardView.setKeyboard(modifiersKeyboard);
104
105 keyboardView.setOnKeyboardActionListener(this);
106 modifiersKeyboardView.setOnKeyboardActionListener(this);
107 }

Member Function Documentation

◆ attachSession()

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

Definition at line 119 of file SessionInputManager.java.

120 {
121 this.instance = instance;
122 this.bitmap = surface;
123 keyboardMapper.reset(this);
124 }

◆ cancelPendingEvents()

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

Definition at line 233 of file SessionInputManager.java.

234 {
235 handler.removeMessages(MSG_SEND_MOVE_EVENT);
236 }

◆ getPinchZoomListener()

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

Definition at line 133 of file SessionInputManager.java.

134 {
135 return pinchZoomListener;
136 }

◆ handleBackAsAltF4()

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

Definition at line 277 of file SessionInputManager.java.

278 {
279 if (instance == 0)
280 return false;
281 if (!ApplicationSettingsActivity.getUseBackAsAltf4(context))
282 return false;
283 keyboardMapper.sendAltF4();
284 return true;
285 }

◆ hideKeyboards()

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

Definition at line 167 of file SessionInputManager.java.

168 {
169 showKeyboard(false, false);
170 }

◆ isAnyKeyboardVisible()

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

Definition at line 173 of file SessionInputManager.java.

174 {
175 return sysKeyboardVisible || extKeyboardVisible;
176 }

◆ modifiersChanged()

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

Definition at line 560 of file SessionInputManager.java.

561 {
562 updateModifierKeyStates();
563 }

◆ onAndroidKeyEvent()

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

Definition at line 255 of file SessionInputManager.java.

256 {
257 if (instance == 0)
258 return false;
259 return keyboardMapper.processAndroidKeyEvent(event);
260 }

◆ onAndroidKeyLongPress()

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

Definition at line 264 of file SessionInputManager.java.

265 {
266 if (instance == 0)
267 return false;
268 if (keyCode == KeyEvent.KEYCODE_BACK)
269 {
270 LibFreeRDP.disconnect(instance);
271 return true;
272 }
273 return false;
274 }

◆ onGenericMotionEvent()

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

Definition at line 239 of file SessionInputManager.java.

240 {
241 if (instance == 0)
242 return false;
243 if (e.getAction() != MotionEvent.ACTION_SCROLL)
244 return false;
245
246 final float vScroll = e.getAxisValue(MotionEvent.AXIS_VSCROLL);
247 if (vScroll < 0)
248 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, false));
249 else if (vScroll > 0)
250 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, true));
251 return true;
252 }

◆ onKey()

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

Definition at line 568 of file SessionInputManager.java.

569 {
570 keyboardMapper.processCustomKeyEvent(primaryCode);
571 }

◆ onPress()

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

Definition at line 593 of file SessionInputManager.java.

594 {
595 }

◆ onRelease()

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

Definition at line 597 of file SessionInputManager.java.

598 {
599 }

◆ 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 393 of file SessionInputManager.java.

394 {
395 scrollView.setScrollEnabled(true);
396 }

◆ onSessionViewHScroll()

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

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

Definition at line 442 of file SessionInputManager.java.

443 {
444 if (instance == 0)
445 return;
446 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getHScrollEvent(context, right));
447 }

◆ 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 398 of file SessionInputManager.java.

399 {
400 if (instance == 0)
401 return;
402 if (!down)
403 cancelDelayedMoveEvent();
404 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getLeftButtonEvent(context, down));
405 }

◆ 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 407 of file SessionInputManager.java.

408 {
409 if (instance == 0)
410 return;
411 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getMiddleButtonEvent(down));
412 }

◆ onSessionViewMouseMove()

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

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

Definition at line 428 of file SessionInputManager.java.

429 {
430 if (instance == 0)
431 return;
432 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getMoveEvent());
433 }

◆ onSessionViewMove()

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

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

Definition at line 421 of file SessionInputManager.java.

422 {
423 if (instance == 0)
424 return;
425 sendDelayedMoveEvent(x, y);
426 }

◆ 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 414 of file SessionInputManager.java.

415 {
416 if (instance == 0)
417 return;
418 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getRightButtonEvent(context, down));
419 }

◆ onSessionViewScroll()

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

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

Definition at line 435 of file SessionInputManager.java.

436 {
437 if (instance == 0)
438 return;
439 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, down));
440 }

◆ onText()

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

Definition at line 573 of file SessionInputManager.java.

574 {
575 }

◆ onTouchPointerClose()

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

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

Definition at line 452 of file SessionInputManager.java.

453 {
454 touchPointerView.setVisibility(View.INVISIBLE);
455 sessionView.setTouchPointerPadding(0, 0);
456 }

◆ 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 458 of file SessionInputManager.java.

459 {
460 if (instance == 0)
461 return;
462 Point p = mapScreenCoordToSessionCoord(x, y);
463 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getLeftButtonEvent(context, down));
464 }

◆ onTouchPointerMove()

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

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

Definition at line 474 of file SessionInputManager.java.

475 {
476 if (instance == 0)
477 return;
478 Point p = mapScreenCoordToSessionCoord(x, y);
479 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getMoveEvent());
480
481 if (ApplicationSettingsActivity.getAutoScrollTouchPointer(context) &&
482 !handler.hasMessages(MSG_SCROLLING_REQUESTED))
483 {
484 handler.sendEmptyMessageDelayed(MSG_SCROLLING_REQUESTED, SCROLLING_TIMEOUT);
485 }
486 }

◆ onTouchPointerMoveEnd()

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

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

Definition at line 488 of file SessionInputManager.java.

489 {
490 handler.removeMessages(MSG_SCROLLING_REQUESTED);
491 }

◆ onTouchPointerResetScrollZoom()

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

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

Definition at line 510 of file SessionInputManager.java.

511 {
512 sessionView.setZoom(1.0f);
513 scrollView.scrollTo(0, 0);
514 }

◆ 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 466 of file SessionInputManager.java.

467 {
468 if (instance == 0)
469 return;
470 Point p = mapScreenCoordToSessionCoord(x, y);
471 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getRightButtonEvent(context, down));
472 }

◆ onTouchPointerScroll()

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

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

Definition at line 493 of file SessionInputManager.java.

494 {
495 if (instance == 0)
496 return;
497 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, down));
498 }

◆ onTouchPointerToggleExtKeyboard()

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

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

Definition at line 505 of file SessionInputManager.java.

506 {
507 toggleExtendedKeyboard();
508 }

◆ onTouchPointerToggleKeyboard()

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

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

Definition at line 500 of file SessionInputManager.java.

501 {
502 toggleSystemKeyboard();
503 }

◆ processUnicodeKey()

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

Definition at line 526 of file SessionInputManager.java.

527 {
528 if (instance == 0)
529 return;
530 if (LibFreeRDP.isUnicodeInputSupported(instance))
531 {
532 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, true);
533 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, false);
534 }
535 else
536 keyboardMapper.processUnicodeFallback(unicodeKey);
537 }

◆ processVirtualKey()

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

Definition at line 519 of file SessionInputManager.java.

520 {
521 if (instance == 0)
522 return;
523 LibFreeRDP.sendKeyEvent(instance, virtualKeyCode, down);
524 }

◆ reloadKeyboards()

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

Definition at line 147 of file SessionInputManager.java.

148 {
149 loadKeyboards();
150 keyboardView.setKeyboard(specialkeysKeyboard);
151 modifiersKeyboardView.setKeyboard(modifiersKeyboard);
152 }

◆ setBitmap()

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

Definition at line 127 of file SessionInputManager.java.

128 {
129 this.bitmap = bitmap;
130 }

◆ setSafeInsets()

void com.freerdp.freerdpcore.presentation.SessionInputManager.setSafeInsets ( int  left,
int  top 
)
inline

Definition at line 67 of file SessionInputManager.java.

68 {
69 safeInsetLeft = left;
70 safeInsetTop = top;
71 }

◆ setScreenSize()

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

Definition at line 139 of file SessionInputManager.java.

140 {
141 this.screenWidth = width;
142 this.screenHeight = height;
143 }

◆ swipeDown()

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

Definition at line 585 of file SessionInputManager.java.

586 {
587 }

◆ swipeLeft()

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

Definition at line 581 of file SessionInputManager.java.

582 {
583 }

◆ swipeRight()

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

Definition at line 577 of file SessionInputManager.java.

578 {
579 }

◆ swipeUp()

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

Definition at line 589 of file SessionInputManager.java.

590 {
591 }

◆ switchKeyboard()

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

Definition at line 539 of file SessionInputManager.java.

540 {
541 switch (keyboardType)
542 {
543 case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS:
544 keyboardView.setKeyboard(specialkeysKeyboard);
545 break;
546
547 case KeyboardMapper.KEYBOARD_TYPE_NUMPAD:
548 keyboardView.setKeyboard(numpadKeyboard);
549 break;
550
551 case KeyboardMapper.KEYBOARD_TYPE_CURSOR:
552 keyboardView.setKeyboard(cursorKeyboard);
553 break;
554
555 default:
556 break;
557 }
558 }

◆ toggleExtendedKeyboard()

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

Definition at line 161 of file SessionInputManager.java.

162 {
163 showKeyboard(false, !extKeyboardVisible);
164 }

◆ toggleSystemKeyboard()

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

Definition at line 155 of file SessionInputManager.java.

156 {
157 showKeyboard(!sysKeyboardVisible, false);
158 }

◆ toggleTouchPointer()

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

Definition at line 288 of file SessionInputManager.java.

289 {
290 if (touchPointerView.getVisibility() == View.VISIBLE)
291 {
292 touchPointerView.setVisibility(View.INVISIBLE);
293 sessionView.setTouchPointerPadding(0, 0);
294 }
295 else
296 {
297 touchPointerView.setVisibility(View.VISIBLE);
298 sessionView.setTouchPointerPadding(touchPointerView.getPointerWidth(),
299 touchPointerView.getPointerHeight());
300 }
301 }

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