Default to TOOL_TYPE_STYLUS for external stylus events.
Change-Id: Ife6a7c4802e8b1ec1ff8445e639f8a6d90a00592
This commit is contained in:
parent
671024b4cd
commit
45ccacf937
@ -6511,6 +6511,11 @@ void ExternalStylusInputMapper::sync(nsecs_t when) {
|
|||||||
|
|
||||||
mStylusState.when = when;
|
mStylusState.when = when;
|
||||||
|
|
||||||
|
mStylusState.toolType = mTouchButtonAccumulator.getToolType();
|
||||||
|
if (mStylusState.toolType == AMOTION_EVENT_TOOL_TYPE_UNKNOWN) {
|
||||||
|
mStylusState.toolType = AMOTION_EVENT_TOOL_TYPE_STYLUS;
|
||||||
|
}
|
||||||
|
|
||||||
int32_t pressure = mSingleTouchMotionAccumulator.getAbsolutePressure();
|
int32_t pressure = mSingleTouchMotionAccumulator.getAbsolutePressure();
|
||||||
if (mRawPressureAxis.valid) {
|
if (mRawPressureAxis.valid) {
|
||||||
mStylusState.pressure = float(pressure) / mRawPressureAxis.maxValue;
|
mStylusState.pressure = float(pressure) / mRawPressureAxis.maxValue;
|
||||||
@ -6521,7 +6526,6 @@ void ExternalStylusInputMapper::sync(nsecs_t when) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mStylusState.buttons = mTouchButtonAccumulator.getButtonState();
|
mStylusState.buttons = mTouchButtonAccumulator.getButtonState();
|
||||||
mStylusState.toolType = mTouchButtonAccumulator.getToolType();
|
|
||||||
|
|
||||||
mContext->dispatchExternalStylusState(mStylusState);
|
mContext->dispatchExternalStylusState(mStylusState);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user