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

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

Member Function Documentation

◆ attachSession()

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

Definition at line 118 of file SessionInputManager.java.

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

◆ cancelPendingEvents()

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

Definition at line 232 of file SessionInputManager.java.

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

◆ getPinchZoomListener()

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

Definition at line 132 of file SessionInputManager.java.

133 {
134 return pinchZoomListener;
135 }

◆ handleBackAsAltF4()

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

Definition at line 276 of file SessionInputManager.java.

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

◆ hideKeyboards()

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

Definition at line 166 of file SessionInputManager.java.

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

◆ isAnyKeyboardVisible()

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

Definition at line 172 of file SessionInputManager.java.

173 {
174 return sysKeyboardVisible || extKeyboardVisible;
175 }

◆ modifiersChanged()

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

Definition at line 555 of file SessionInputManager.java.

556 {
557 updateModifierKeyStates();
558 }

◆ onAndroidKeyEvent()

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

Definition at line 254 of file SessionInputManager.java.

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

◆ onAndroidKeyLongPress()

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

Definition at line 263 of file SessionInputManager.java.

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

◆ onGenericMotionEvent()

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

Definition at line 238 of file SessionInputManager.java.

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

◆ onKey()

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

Definition at line 563 of file SessionInputManager.java.

564 {
565 keyboardMapper.processCustomKeyEvent(primaryCode);
566 }

◆ onPress()

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

Definition at line 588 of file SessionInputManager.java.

589 {
590 }

◆ onRelease()

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

Definition at line 592 of file SessionInputManager.java.

593 {
594 }

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

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

◆ onSessionViewHScroll()

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

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

Definition at line 441 of file SessionInputManager.java.

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

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

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

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

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

◆ onSessionViewMouseMove()

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

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

Definition at line 427 of file SessionInputManager.java.

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

◆ onSessionViewMove()

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

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

Definition at line 420 of file SessionInputManager.java.

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

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

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

◆ onSessionViewScroll()

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

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

Definition at line 434 of file SessionInputManager.java.

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

◆ onText()

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

Definition at line 568 of file SessionInputManager.java.

569 {
570 }

◆ onTouchPointerClose()

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

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

Definition at line 451 of file SessionInputManager.java.

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

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

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

◆ onTouchPointerMove()

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

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

Definition at line 473 of file SessionInputManager.java.

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

◆ onTouchPointerResetScrollZoom()

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

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

Definition at line 505 of file SessionInputManager.java.

506 {
507 sessionView.setZoom(1.0f);
508 scrollView.scrollTo(0, 0);
509 }

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

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

◆ onTouchPointerScroll()

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

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

Definition at line 488 of file SessionInputManager.java.

489 {
490 if (instance == 0)
491 return;
492 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, down));
493 }

◆ onTouchPointerToggleExtKeyboard()

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

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

Definition at line 500 of file SessionInputManager.java.

501 {
502 toggleExtendedKeyboard();
503 }

◆ onTouchPointerToggleKeyboard()

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

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

Definition at line 495 of file SessionInputManager.java.

496 {
497 toggleSystemKeyboard();
498 }

◆ processUnicodeKey()

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

Definition at line 521 of file SessionInputManager.java.

522 {
523 if (instance == 0)
524 return;
525 if (LibFreeRDP.isUnicodeInputSupported(instance))
526 {
527 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, true);
528 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, false);
529 }
530 else
531 keyboardMapper.processUnicodeFallback(unicodeKey);
532 }

◆ processVirtualKey()

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

Definition at line 514 of file SessionInputManager.java.

515 {
516 if (instance == 0)
517 return;
518 LibFreeRDP.sendKeyEvent(instance, virtualKeyCode, down);
519 }

◆ reloadKeyboards()

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

Definition at line 146 of file SessionInputManager.java.

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

◆ setBitmap()

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

Definition at line 126 of file SessionInputManager.java.

127 {
128 this.bitmap = bitmap;
129 }

◆ setSafeInsets()

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

Definition at line 66 of file SessionInputManager.java.

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

◆ setScreenSize()

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

Definition at line 138 of file SessionInputManager.java.

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

◆ swipeDown()

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

Definition at line 580 of file SessionInputManager.java.

581 {
582 }

◆ swipeLeft()

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

Definition at line 576 of file SessionInputManager.java.

577 {
578 }

◆ swipeRight()

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

Definition at line 572 of file SessionInputManager.java.

573 {
574 }

◆ swipeUp()

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

Definition at line 584 of file SessionInputManager.java.

585 {
586 }

◆ switchKeyboard()

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

Definition at line 534 of file SessionInputManager.java.

535 {
536 switch (keyboardType)
537 {
538 case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS:
539 keyboardView.setKeyboard(specialkeysKeyboard);
540 break;
541
542 case KeyboardMapper.KEYBOARD_TYPE_NUMPAD:
543 keyboardView.setKeyboard(numpadKeyboard);
544 break;
545
546 case KeyboardMapper.KEYBOARD_TYPE_CURSOR:
547 keyboardView.setKeyboard(cursorKeyboard);
548 break;
549
550 default:
551 break;
552 }
553 }

◆ toggleExtendedKeyboard()

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

Definition at line 160 of file SessionInputManager.java.

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

◆ toggleSystemKeyboard()

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

Definition at line 154 of file SessionInputManager.java.

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

◆ toggleTouchPointer()

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

Definition at line 287 of file SessionInputManager.java.

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

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