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 onTouchPointerMove (int x, int y)
 
void onTouchPointerMoveEnd ()
 
void onTouchPointerScroll (boolean down)
 
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 500 of file SessionInputManager.java.

501 {
502 return keyboardMapper.getModifierState(keycode);
503 }

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

483 {
484 keyboard.refreshModifiers();
485 }

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

506 {
507 // the expanded panel replaces the system IME; collapsing brings it back
508 setSoftInputState(!expanded);
509 }

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

491 {
492 keyboardMapper.processCustomKeyEvent(keycode);
493 }

◆ onKeyLock()

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

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

Definition at line 495 of file SessionInputManager.java.

496 {
497 keyboardMapper.processCustomKeyLock(keycode);
498 }

◆ 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 }

◆ 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 }

◆ onTouchPointerMove()

void com.freerdp.freerdpcore.presentation.SessionInputManager.onTouchPointerMove ( int  x,
int  y 
)
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.getMoveEvent());
411
412 if (ApplicationSettingsActivity.getAutoScrollTouchPointer(context) &&
413 !handler.hasMessages(MSG_SCROLLING_REQUESTED))
414 {
415 handler.sendEmptyMessageDelayed(MSG_SCROLLING_REQUESTED, SCROLLING_TIMEOUT);
416 }
417 }

◆ onTouchPointerMoveEnd()

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

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

Definition at line 419 of file SessionInputManager.java.

420 {
421 handler.removeMessages(MSG_SCROLLING_REQUESTED);
422 }

◆ onTouchPointerResetScrollZoom()

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

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

Definition at line 436 of file SessionInputManager.java.

437 {
438 sessionView.setZoom(1.0f);
439 scrollView.scrollTo(0, 0);
440 }

◆ 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 ( boolean  down)
inline

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

Definition at line 424 of file SessionInputManager.java.

425 {
426 if (instance == 0)
427 return;
428 LibFreeRDP.sendCursorEvent(instance, 0, 0, Mouse.getScrollEvent(context, down));
429 }

◆ onTouchPointerToggleKeyboard()

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

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

Definition at line 431 of file SessionInputManager.java.

432 {
433 toggleKeyboard();
434 }

◆ processUnicodeKey()

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

Definition at line 452 of file SessionInputManager.java.

453 {
454 if (instance == 0)
455 return;
456 if (LibFreeRDP.isUnicodeInputSupported(instance))
457 {
458 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, true);
459 LibFreeRDP.sendUnicodeKeyEvent(instance, unicodeKey, false);
460 }
461 else
462 keyboardMapper.processUnicodeFallback(unicodeKey);
463 }

◆ processVirtualKey()

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

Definition at line 445 of file SessionInputManager.java.

446 {
447 if (instance == 0)
448 return;
449 LibFreeRDP.sendKeyEvent(instance, virtualKeyCode, down);
450 }

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

466 {
467 switch (keyboardType)
468 {
469 case KeyboardMapper.KEYBOARD_TYPE_FUNCTIONKEYS:
470 keyboard.selectPage(ExtendedKeyboardView.PAGE_SPECIAL);
471 break;
472
473 case KeyboardMapper.KEYBOARD_TYPE_NUMPAD:
474 keyboard.selectPage(ExtendedKeyboardView.PAGE_NUM);
475 break;
476
477 default:
478 break;
479 }
480 }

◆ 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: