中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

網(wǎng)站外鏈帶nofollow是什么意思網(wǎng)站快速優(yōu)化排名官網(wǎng)

網(wǎng)站外鏈帶nofollow是什么意思,網(wǎng)站快速優(yōu)化排名官網(wǎng),人大網(wǎng)站建設情況介紹,公司網(wǎng)站怎么做簡介因為公司產(chǎn)品是一款vr,是沒有觸摸屏的,所有要想用藍牙手柄操控LatinIME就得進行修改 LatinIME最主要的就是一個繼承InputMethodService的服務,類名就是LatinIME.java 而MainKeyboardView.java就是畫出來的那塊鍵盤了,主要的響應觸摸,傳遞鍵值都繞不過它調(diào)用的PointerTracker.…

因為公司產(chǎn)品是一款vr,是沒有觸摸屏的,所有要想用藍牙手柄操控LatinIME就得進行修改

LatinIME最主要的就是一個繼承InputMethodService的服務,類名就是LatinIME.java

而MainKeyboardView.java就是畫出來的那塊鍵盤了,主要的響應觸摸,傳遞鍵值都繞不過它調(diào)用的PointerTracker.java

直接看響應觸摸的吧

通過onTouchEvent找到processMotionEvent(me);然后在processMotionEvent(me);看到tracker.processMotionEvent(me, mKeyDetector);

@Overridepublic boolean onTouchEvent(final MotionEvent me) {if (getKeyboard() == null) {return false;}if (mNonDistinctMultitouchHelper != null) {if (me.getPointerCount() > 1 && mKeyTimerHandler.isInKeyRepeat()) {// Key repeating timer will be canceled if 2 or more keys are in action.mKeyTimerHandler.cancelKeyRepeatTimers();}// Non distinct multitouch screen supportmNonDistinctMultitouchHelper.processMotionEvent(me, mKeyDetector);return true;}return processMotionEvent(me);}public boolean processMotionEvent(final MotionEvent me) {final int index = me.getActionIndex();final int id = me.getPointerId(index);final PointerTracker tracker = PointerTracker.getPointerTracker(id);// When a more keys panel is showing, we should ignore other fingers' single touch events// other than the finger that is showing the more keys panel.if (isShowingMoreKeysPanel() && !tracker.isShowingMoreKeysPanel()&& PointerTracker.getActivePointerTrackerCount() == 1) {return true;}tracker.processMotionEvent(me, mKeyDetector);return true;}

觸摸是在PointerTracker.java的processMotionEvent(me, mKeyDetector);里進行處理的

而PointerTracker.java里還有兩個接口DrawingProxy和TimerProxy

public interface DrawingProxy {public void invalidateKey(Key key);public void showKeyPreview(Key key);public void dismissKeyPreview(Key key);public void showSlidingKeyInputPreview(PointerTracker tracker);public void dismissSlidingKeyInputPreview();public void showGestureTrail(PointerTracker tracker, boolean showsFloatingPreviewText);}public interface TimerProxy {public void startTypingStateTimer(Key typedKey);public boolean isTypingState();public void startKeyRepeatTimerOf(PointerTracker tracker, int repeatCount, int delay);public void startLongPressTimerOf(PointerTracker tracker, int delay);public void cancelLongPressTimerOf(PointerTracker tracker);public void cancelLongPressShiftKeyTimers();public void cancelKeyTimersOf(PointerTracker tracker);public void startDoubleTapShiftKeyTimer();public void cancelDoubleTapShiftKeyTimer();public boolean isInDoubleTapShiftKeyTimeout();public void startUpdateBatchInputTimer(PointerTracker tracker);public void cancelUpdateBatchInputTimer(PointerTracker tracker);public void cancelAllUpdateBatchInputTimers();public static class Adapter implements TimerProxy {@Overridepublic void startTypingStateTimer(Key typedKey) {}@Overridepublic boolean isTypingState() { return false; }@Overridepublic void startKeyRepeatTimerOf(PointerTracker tracker, int repeatCount, int delay) {}@Overridepublic void startLongPressTimerOf(PointerTracker tracker, int delay) {}@Overridepublic void cancelLongPressTimerOf(PointerTracker tracker) {}@Overridepublic void cancelLongPressShiftKeyTimers() {}@Overridepublic void cancelKeyTimersOf(PointerTracker tracker) {}@Overridepublic void startDoubleTapShiftKeyTimer() {}@Overridepublic void cancelDoubleTapShiftKeyTimer() {}@Overridepublic boolean isInDoubleTapShiftKeyTimeout() { return false; }@Overridepublic void startUpdateBatchInputTimer(PointerTracker tracker) {}@Overridepublic void cancelUpdateBatchInputTimer(PointerTracker tracker) {}@Overridepublic void cancelAllUpdateBatchInputTimers() {}}}

TimerProxy是按下去時計時的,不用管,而DrawingProxy就是畫的接口了

包括按下去時字母背景變黑和彈出pop,抬起時恢復等等

接著看processMotionEvent

public void processMotionEvent(final MotionEvent me, final KeyDetector keyDetector) {final int action = me.getActionMasked();final long eventTime = me.getEventTime();if (action == MotionEvent.ACTION_MOVE) {// When this pointer is the only active pointer and is showing a more keys panel,// we should ignore other pointers' motion event.final boolean shouldIgnoreOtherPointers =isShowingMoreKeysPanel() && getActivePointerTrackerCount() == 1;final int pointerCount = me.getPointerCount();for (int index = 0; index < pointerCount; index++) {final int id = me.getPointerId(index);if (shouldIgnoreOtherPointers && id != mPointerId) {continue;}final int x = (int)me.getX(index);final int y = (int)me.getY(index);final PointerTracker tracker = getPointerTracker(id);tracker.onMoveEvent(x, y, eventTime, me);}return;}final int index = me.getActionIndex();final int x = (int)me.getX(index);final int y = (int)me.getY(index);switch (action) {case MotionEvent.ACTION_DOWN:case MotionEvent.ACTION_POINTER_DOWN:onDownEvent(x, y, eventTime, keyDetector);break;case MotionEvent.ACTION_UP:case MotionEvent.ACTION_POINTER_UP:onUpEvent(x, y, eventTime);break;case MotionEvent.ACTION_CANCEL:onCancelEvent(x, y, eventTime);break;}}

響應觸摸主要是onDownEvent(x, y, eventTime, keyDetector);和onUpEvent(x, y, eventTime);兩個方法

private void onDownEvent(final int x, final int y, final long eventTime,final KeyDetector keyDetector) {setKeyDetectorInner(keyDetector);if (DEBUG_EVENT) {printTouchEvent("onDownEvent:", x, y, eventTime);}// Naive up-to-down noise filter.final long deltaT = eventTime - mUpTime;if (deltaT < sParams.mTouchNoiseThresholdTime) {final int distance = getDistance(x, y, mLastX, mLastY);if (distance < sParams.mTouchNoiseThresholdDistance) {if (DEBUG_MODE)Log.w(TAG, String.format("[%d] onDownEvent:"+ " ignore potential noise: time=%d distance=%d",mPointerId, deltaT, distance));cancelTrackingForAction();return;}}final Key key = getKeyOn(x, y);mBogusMoveEventDetector.onActualDownEvent(x, y);if (key != null && key.isModifier()) {// Before processing a down event of modifier key, all pointers already being// tracked should be released.sPointerTrackerQueue.releaseAllPointers(eventTime);}sPointerTrackerQueue.add(this);onDownEventInternal(x, y, eventTime);if (!sGestureEnabler.shouldHandleGesture()) {return;}// A gesture should start only from a non-modifier key. Note that the gesture detection is// disabled when the key is repeating.mIsDetectingGesture = (mKeyboard != null) && mKeyboard.mId.isAlphabetKeyboard()&& key != null && !key.isModifier();if (mIsDetectingGesture) {mBatchInputArbiter.addDownEventPoint(x, y, eventTime,sTypingTimeRecorder.getLastLetterTypingTime(), getActivePointerTrackerCount());mGestureStrokeDrawingPoints.onDownEvent(x, y, mBatchInputArbiter.getElapsedTimeSinceFirstDown(eventTime));}}/* package */ boolean isShowingMoreKeysPanel() {return (mMoreKeysPanel != null);}

private void onUpEvent(final int x, final int y, final long eventTime) {if (DEBUG_EVENT) {printTouchEvent("onUpEvent  :", x, y, eventTime);}sTimerProxy.cancelUpdateBatchInputTimer(this);if (!sInGesture) {if (mCurrentKey != null && mCurrentKey.isModifier()) {// Before processing an up event of modifier key, all pointers already being// tracked should be released.sPointerTrackerQueue.releaseAllPointersExcept(this, eventTime);} else {sPointerTrackerQueue.releaseAllPointersOlderThan(this, eventTime);}}onUpEventInternal(x, y, eventTime);sPointerTrackerQueue.remove(this);}

onDownEvent中的onDownEventInternal(final int x, final int y, final long eventTime)和onUpEvent中的onUpEventInternal(final int x, final int y, final long eventTime)方法對觸摸進行了處理

private void onDownEventInternal(final int x, final int y, final long eventTime) {Key key = onDownKey(x, y, eventTime);// Key selection by dragging finger is allowed when 1) key selection by dragging finger is// enabled by configuration, 2) this pointer starts dragging from modifier key, or 3) this// pointer's KeyDetector always allows key selection by dragging finger, such as// {@link MoreKeysKeyboard}.mIsAllowedDraggingFinger = sParams.mKeySelectionByDraggingFinger|| (key != null && key.isModifier())|| mKeyDetector.alwaysAllowsKeySelectionByDraggingFinger();mKeyboardLayoutHasBeenChanged = false;mIsTrackingForActionDisabled = false;resetKeySelectionByDraggingFinger();if (key != null) {// This onPress call may have changed keyboard layout. Those cases are detected at// {@link #setKeyboard}. In those cases, we should update key according to the new// keyboard layout.if (callListenerOnPressAndCheckKeyboardLayoutChange(key, 0 /* repeatCount */)) {key = onDownKey(x, y, eventTime);}startRepeatKey(key);startLongPressTimer(key);setPressedKeyGraphics(key, eventTime);}}

private void onUpEventInternal(final int x, final int y, final long eventTime) {sTimerProxy.cancelKeyTimersOf(this);final boolean isInDraggingFinger = mIsInDraggingFinger;final boolean isInSlidingKeyInput = mIsInSlidingKeyInput;resetKeySelectionByDraggingFinger();mIsDetectingGesture = false;final Key currentKey = mCurrentKey;mCurrentKey = null;final int currentRepeatingKeyCode = mCurrentRepeatingKeyCode;mCurrentRepeatingKeyCode = Constants.NOT_A_CODE;// Release the last pressed key.setReleasedKeyGraphics(currentKey);if (isShowingMoreKeysPanel()) {if (!mIsTrackingForActionDisabled) {final int translatedX = mMoreKeysPanel.translateX(x);final int translatedY = mMoreKeysPanel.translateY(y);mMoreKeysPanel.onUpEvent(translatedX, translatedY, mPointerId, eventTime);}dismissMoreKeysPanel();return;}if (sInGesture) {if (currentKey != null) {callListenerOnRelease(currentKey, currentKey.getCode(), true /* withSliding */);}if (mBatchInputArbiter.mayEndBatchInput(eventTime, getActivePointerTrackerCount(), this)) {sInGesture = false;}showGestureTrail();return;}if (mIsTrackingForActionDisabled) {return;}if (currentKey != null && currentKey.isRepeatable()&& (currentKey.getCode() == currentRepeatingKeyCode) && !isInDraggingFinger) {return;}detectAndSendKey(currentKey, mKeyX, mKeyY, eventTime);if (isInSlidingKeyInput) {callListenerOnFinishSlidingInput();}}

而這兩個方法中分別有setPressedKeyGraphics(key, eventTime);和setReleasedKeyGraphics(currentKey);兩個方法通過DrawingProxy接口傳到MainKeyboardView.java,

然后由MainKeyboardView.java畫出觸摸按下去和釋放在鍵盤上的顯示效果

onDownEventInternal中的

if (callListenerOnPressAndCheckKeyboardLayoutChange(key, 0 /* repeatCount */)) {
??????????????? key = onDownKey(x, y, eventTime);
??????????? }

是按下大寫鍵后,整個鍵盤改變大小寫狀態(tài)的

而onUpEventInternal中的detectAndSendKey(currentKey, mKeyX, mKeyY, eventTime);方法調(diào)用callListenerOnCodeInput(key, code, x, y, eventTime, false /* isKeyRepeat */);

通過KeyboardActionListener接口將key傳到LatinIME.java中的onCodeInput方法中進行處理







http://m.risenshineclean.com/news/61880.html

相關文章:

  • 網(wǎng)絡技術(shù)與網(wǎng)站建設seo網(wǎng)站優(yōu)化課程
  • 東南網(wǎng)架公司哈爾濱seo和網(wǎng)絡推廣
  • 貴港網(wǎng)站設計免費發(fā)布網(wǎng)站seo外鏈
  • 外貿(mào)添加外鏈網(wǎng)站建站網(wǎng)站
  • 有ip怎么用自己的主機做網(wǎng)站灰色項目推廣渠道
  • 引用網(wǎng)站的內(nèi)容如何做注釋排行榜軟件
  • 寧波市住房與城鄉(xiāng)建設部網(wǎng)站百度推廣一天燒幾千
  • 專業(yè)攝影網(wǎng)站杭州網(wǎng)站優(yōu)化服務
  • 高端服裝產(chǎn)品網(wǎng)站建設seo建站平臺哪家好
  • 網(wǎng)站策劃步驟網(wǎng)站交易
  • 個人網(wǎng)站設計成首頁網(wǎng)絡營銷的實現(xiàn)方式
  • 網(wǎng)站建設 事業(yè)單位 安全外貿(mào)網(wǎng)站平臺都有哪些 免費的
  • JAVA網(wǎng)站開發(fā)ssm朝陽區(qū)seo搜索引擎優(yōu)化介紹
  • 網(wǎng)站建設公司哪好建站優(yōu)化推廣
  • 客戶做網(wǎng)站需要提供什么百度收錄提交申請網(wǎng)站
  • 網(wǎng)站后臺 ftp網(wǎng)站建設seo優(yōu)化培訓
  • 網(wǎng)站開發(fā)下載現(xiàn)在最火的推廣平臺
  • 網(wǎng)站開發(fā)如何入賬sem優(yōu)化師
  • 網(wǎng)站建設平臺合同模板下載優(yōu)化器
  • 個人做新聞網(wǎng)站處罰網(wǎng)站推廣的方式和方法
  • 東莞證券官方網(wǎng)站怎么創(chuàng)建域名
  • 大數(shù)據(jù)智能營銷靠譜嗎優(yōu)化設計電子版
  • 創(chuàng)業(yè)網(wǎng)站開發(fā)要多少錢開封網(wǎng)絡推廣哪家好
  • 建設網(wǎng)站項目的目的是什么企業(yè)網(wǎng)絡營銷目標
  • 網(wǎng)站建設知名免費下載百度一下
  • 電影網(wǎng)站制作畢業(yè)論文摘要工具站seo
  • 怎么自己學著做網(wǎng)站搜索熱門關鍵詞
  • 萬網(wǎng)注冊域名做簡單網(wǎng)站成都seo
  • 湖南做網(wǎng)站 真好磐石網(wǎng)絡網(wǎng)站優(yōu)化推廣方案
  • 曾經(jīng)做博彩網(wǎng)站代理去除痘痘怎么有效果