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, ExtendedKeyboardView keyboard)
 
void attachSession (long instance, Bitmap surface)
 
void setBitmap (Bitmap bitmap)
 
ScaleGestureDetector.OnScaleGestureListener getPinchZoomListener ()
 
void setScreenSize (int width, int height)
 
void toggleKeyboard ()
 
void hideKeyboards ()
 
boolean handleKeyboardBack ()
 
boolean isSoftInputActive ()
 
void onImeVisibilityChanged (boolean visible)
 
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 onTouchPointerMiddleClick (int x, int y, boolean down)
 
void onTouchPointerMove (int x, int y)
 
void onTouchPointerMoveEnd ()
 
void onTouchPointerScroll (int amount)
 
void onTouchPointerHScroll (int amount)
 
void onTouchPointerToggleKeyboard ()
 
void onTouchPointerResetScrollZoom ()
 
void processVirtualKey (int virtualKeyCode, boolean down)
 
void processUnicodeKey (int unicodeKey)
 
void switchKeyboard (int keyboardType)
 
void modifiersChanged ()
 
void onKey (int keycode)
 
void onKeyLock (int keycode)
 
int getModifierState (int keycode)
 
void onExpandedChanged (boolean expanded)
 

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,
ExtendedKeyboardView  keyboard 
)
inline

Definition at line 66 of file SessionInputManager.java.

68 {
69 this.context = context;
70 this.scrollView = scrollView;
71 this.sessionView = sessionView;
72 this.touchPointerView = touchPointerView;
73 this.keyboard = keyboard;
74 this.handler = new InputHandler();
75
76 this.keyboardMapper = new KeyboardMapper();
77 this.keyboardMapper.init(context);
78
79 keyboard.setListener(this);
80 }

Member Function Documentation

◆ attachSession()

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

Definition at line 83 of file SessionInputManager.java.

84 {
85 this.instance = instance;
86 this.bitmap = surface;
87 keyboardMapper.reset(this);
88 }

◆ cancelPendingEvents()

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

Definition at line 200 of file SessionInputManager.java.

201 {
202 handler.removeMessages(MSG_SEND_MOVE_EVENT);
203 }

◆ getModifierState()

int com.freerdp.freerdpcore.presentation.SessionInputManager.getModifierState ( int  keycode)
inline

Implements com.freerdp.freerdpcore.presentation.ExtendedKeyboardView.Listener.

Definition at line 515 of file SessionInputManager.java.

516 {
517 return keyboardMapper.getModifierState(keycode);
518 }

◆ getPinchZoomListener()

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

Definition at line 97 of file SessionInputManager.java.

98 {
99 return pinchZoomListener;
100 }

◆ handleBackAsAltF4()

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

Definition at line 244 of file SessionInputManager.java.

245 {
246 if (instance == 0)
247 return false;
248 if (!ApplicationSettingsActivity.getUseBackAsAltf4(context))
249 return false;
250 keyboardMapper.sendAltF4();
251 return true;
252 }

◆ handleKeyboardBack()

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

Definition at line 136 of file SessionInputManager.java.

137 {
138 if (keyboard.getVisibility() != View.VISIBLE)
139 return false;
140
141 if (keyboard.isExpanded())
142 {
143 keyboard.setExpanded(false, false);
144 // deliberately no IME here, so the next back press hides the bar as well
145 refreshSystemBars();
146 scrollView.requestApplyInsets();
147 return true;
148 }
149
150 hideKeyboards();
151 return true;
152 }

◆ hideKeyboards()

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

Definition at line 125 of file SessionInputManager.java.

126 {
127 keyboard.setExpanded(false, false);
128 keyboard.setVisibility(View.GONE);
129 setSoftInputState(false);
130 keyboardMapper.clearlAllModifiers();
131 // the IME dismiss animation may re-show the nav bar after the refresh above
132 scrollView.post(this::refreshSystemBars);
133 }

◆ isSoftInputActive()

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

Definition at line 155 of file SessionInputManager.java.

156 {
157 return keyboard.getVisibility() == View.VISIBLE && (softInputRequested || softInputVisible);
158 }

◆ modifiersChanged()

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

Definition at line 497 of file SessionInputManager.java.

498 {
499 keyboard.refreshModifiers();
500 }

◆ onAndroidKeyEvent()

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

Definition at line 222 of file SessionInputManager.java.

223 {
224 if (instance == 0)
225 return false;
226 return keyboardMapper.processAndroidKeyEvent(event);
227 }

◆ onAndroidKeyLongPress()

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

Definition at line 231 of file SessionInputManager.java.

232 {
233 if (instance == 0)
234 return false;
235 if (keyCode == KeyEvent.KEYCODE_BACK)
236 {
237 LibFreeRDP.disconnect(instance);
238 return true;
239 }
240 return false;
241 }

◆ onExpandedChanged()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onExpandedChanged ( boolean  expanded)
inline

Implements com.freerdp.freerdpcore.presentation.ExtendedKeyboardView.Listener.

Definition at line 520 of file SessionInputManager.java.

521 {
522 // the expanded panel replaces the system IME; collapsing brings it back
523 setSoftInputState(!expanded);
524 }

◆ onGenericMotionEvent()

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

Definition at line 206 of file SessionInputManager.java.

207 {
208 if (instance == 0)
209 return false;
210 if (e.getAction() != MotionEvent.ACTION_SCROLL)
211 return false;
212
213 final float vScroll = e.getAxisValue(MotionEvent.AXIS_VSCROLL);
214 if (vScroll < 0)
215 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, false));
216 else if (vScroll > 0)
217 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, true));
218 return true;
219 }

◆ onImeVisibilityChanged()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onImeVisibilityChanged ( boolean  visible)
inline

Definition at line 162 of file SessionInputManager.java.

163 {
164 if (visible == softInputVisible)
165 return;
166 softInputVisible = visible;
167 if (!visible)
168 softInputRequested = false;
169 refreshSystemBars();
170 }

◆ onKey()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onKey ( int  keycode)
inline

Implements com.freerdp.freerdpcore.presentation.ExtendedKeyboardView.Listener.

Definition at line 505 of file SessionInputManager.java.

506 {
507 keyboardMapper.processCustomKeyEvent(keycode);
508 }

◆ onKeyLock()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onKeyLock ( int  keycode)
inline

Implements com.freerdp.freerdpcore.presentation.ExtendedKeyboardView.Listener.

Definition at line 510 of file SessionInputManager.java.

511 {
512 keyboardMapper.processCustomKeyLock(keycode);
513 }

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

325 {
326 scrollView.setScrollEnabled(true);
327 }

◆ onSessionViewHScroll()

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

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

Definition at line 373 of file SessionInputManager.java.

374 {
375 if (instance == 0)
376 return;
377 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getHScrollEvent(context, right));
378 }

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

330 {
331 if (instance == 0)
332 return;
333 if (!down)
334 cancelDelayedMoveEvent();
335 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getLeftButtonEvent(context, down));
336 }

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

339 {
340 if (instance == 0)
341 return;
342 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getMiddleButtonEvent(down));
343 }

◆ onSessionViewMouseMove()

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

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

Definition at line 359 of file SessionInputManager.java.

360 {
361 if (instance == 0)
362 return;
363 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getMoveEvent());
364 }

◆ onSessionViewMove()

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

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

Definition at line 352 of file SessionInputManager.java.

353 {
354 if (instance == 0)
355 return;
356 sendDelayedMoveEvent(x, y);
357 }

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

346 {
347 if (instance == 0)
348 return;
349 LibFreeRDP.sendCursorEvent(instance, x, y, Mouse.getRightButtonEvent(context, down));
350 }

◆ onSessionViewScroll()

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

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

Definition at line 366 of file SessionInputManager.java.

367 {
368 if (instance == 0)
369 return;
370 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, down));
371 }

◆ onTouchPointerClose()

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

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

Definition at line 383 of file SessionInputManager.java.

384 {
385 touchPointerView.setVisibility(View.INVISIBLE);
386 sessionView.setTouchPointerPadding(0, 0);
387 }

◆ onTouchPointerHScroll()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerHScroll ( int  amount)
inline

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

Definition at line 439 of file SessionInputManager.java.

440 {
441 if (instance == 0)
442 return;
443 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getHScrollEvent(context, amount));
444 }

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

390 {
391 if (instance == 0)
392 return;
393 Point p = mapScreenCoordToSessionCoord(x, y);
394 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getLeftButtonEvent(context, down));
395 }

◆ onTouchPointerMiddleClick()

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

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

Definition at line 405 of file SessionInputManager.java.

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

◆ onTouchPointerMove()

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

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

Definition at line 413 of file SessionInputManager.java.

414 {
415 if (instance == 0)
416 return;
417 Point p = mapScreenCoordToSessionCoord(x, y);
418 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getMoveEvent());
419
420 if (ApplicationSettingsActivity.getAutoScrollTouchPointer(context) &&
421 !handler.hasMessages(MSG_SCROLLING_REQUESTED))
422 {
423 handler.sendEmptyMessageDelayed(MSG_SCROLLING_REQUESTED, SCROLLING_TIMEOUT);
424 }
425 }

◆ onTouchPointerMoveEnd()

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

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

Definition at line 427 of file SessionInputManager.java.

428 {
429 handler.removeMessages(MSG_SCROLLING_REQUESTED);
430 }

◆ onTouchPointerResetScrollZoom()

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

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

Definition at line 451 of file SessionInputManager.java.

452 {
453 sessionView.setZoom(1.0f);
454 scrollView.scrollTo(0, 0);
455 }

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

398 {
399 if (instance == 0)
400 return;
401 Point p = mapScreenCoordToSessionCoord(x, y);
402 LibFreeRDP.sendCursorEvent(instance, p.x, p.y, Mouse.getRightButtonEvent(context, down));
403 }

◆ onTouchPointerScroll()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerScroll ( int  amount)
inline

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

Definition at line 432 of file SessionInputManager.java.

433 {
434 if (instance == 0)
435 return;
436 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, amount));
437 }

◆ onTouchPointerToggleKeyboard()

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

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

Definition at line 446 of file SessionInputManager.java.

447 {
448 toggleKeyboard();
449 }

◆ processUnicodeKey()

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

Definition at line 467 of file SessionInputManager.java.

468 {
469 if (instance == 0)
470 return;
471 if (LibFreeRDP.isUnicodeInputSupported(instance))
472 {
473 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, true);
474 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, false);
475 }
476 else
477 keyboardMapper.processUnicodeFallback(unicodeKey);
478 }

◆ processVirtualKey()

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

Definition at line 460 of file SessionInputManager.java.

461 {
462 if (instance == 0)
463 return;
464 LibFreeRDP.sendKeyEvent(instance, virtualKeyCode, down);
465 }

◆ setBitmap()

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

Definition at line 91 of file SessionInputManager.java.

92 {
93 this.bitmap = bitmap;
94 }

◆ setScreenSize()

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

Definition at line 103 of file SessionInputManager.java.

104 {
105 this.screenWidth = width;
106 this.screenHeight = height;
107 }

◆ switchKeyboard()

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

Definition at line 480 of file SessionInputManager.java.

481 {
482 switch (keyboardType)
483 {
484 case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS:
485 keyboard.selectPage(ExtendedKeyboardView.PAGE_SPECIAL);
486 break;
487
488 case KeyboardMapper.KEYBOARD_TYPE_NUMPAD:
489 keyboard.selectPage(ExtendedKeyboardView.PAGE_NUM);
490 break;
491
492 default:
493 break;
494 }
495 }

◆ toggleKeyboard()

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

Definition at line 110 of file SessionInputManager.java.

111 {
112 if (keyboard.getVisibility() == View.VISIBLE)
113 {
114 hideKeyboards();
115 }
116 else
117 {
118 keyboard.setExpanded(false, false);
119 keyboard.setVisibility(View.VISIBLE);
120 setSoftInputState(true);
121 }
122 }

◆ toggleTouchPointer()

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

Definition at line 255 of file SessionInputManager.java.

256 {
257 if (touchPointerView.getVisibility() == View.VISIBLE)
258 {
259 touchPointerView.setVisibility(View.INVISIBLE);
260 sessionView.setTouchPointerPadding(0, 0);
261 }
262 else
263 {
264 touchPointerView.setVisibility(View.VISIBLE);
265 sessionView.setTouchPointerPadding(touchPointerView.getPointerWidth(),
266 touchPointerView.getPointerHeight());
267 }
268 }

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