@quenty/inputmode 8.0.0 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +2 -2
- package/src/Client/InputModeServiceClient.lua +26 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.1.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/inputmode@8.0.0...@quenty/inputmode@8.1.0) (2023-10-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* MouseMovement doesn't flicker when connecting PS5 controller to PC ([af4c08f](https://github.com/Quenty/NevermoreEngine/commit/af4c08fd902979f5cdec63d8cae9730e02c049b3))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [8.0.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/inputmode@7.30.0...@quenty/inputmode@8.0.0) (2023-10-11)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/inputmode
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/inputmode",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"description": "Trace input mode state and trigger changes correctly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"publishConfig": {
|
|
37
37
|
"access": "public"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "eddeed5f503f338926e804d9c11297139f447c6f"
|
|
40
40
|
}
|
|
@@ -115,6 +115,11 @@ function InputModeServiceClient:_bindProcessor()
|
|
|
115
115
|
self._inputModeProcessor:Evaluate(inputObject)
|
|
116
116
|
self:GetInputMode(InputModeTypes.Thumbsticks):Enable()
|
|
117
117
|
end
|
|
118
|
+
elseif inputObject.UserInputType == Enum.UserInputType.MouseMovement then
|
|
119
|
+
-- Prevent mouse movement from flickering
|
|
120
|
+
if self:_shouldProcessMouseMovement(inputObject) then
|
|
121
|
+
self._inputModeProcessor:Evaluate(inputObject)
|
|
122
|
+
end
|
|
118
123
|
else
|
|
119
124
|
self._inputModeProcessor:Evaluate(inputObject)
|
|
120
125
|
end
|
|
@@ -129,6 +134,27 @@ function InputModeServiceClient:_bindProcessor()
|
|
|
129
134
|
end))
|
|
130
135
|
end
|
|
131
136
|
|
|
137
|
+
function InputModeServiceClient:_shouldProcessMouseMovement(inputObject)
|
|
138
|
+
-- Prevent mouse movement from flickering
|
|
139
|
+
local position = inputObject.Position
|
|
140
|
+
local lastMousePosition = self._lastMousePosition
|
|
141
|
+
self._lastMousePosition = position
|
|
142
|
+
|
|
143
|
+
if inputObject.Delta.magnitude > 0 then
|
|
144
|
+
return true
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if not lastMousePosition then
|
|
148
|
+
return true
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if (lastMousePosition - position).magnitude > 0 then
|
|
152
|
+
return true
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
return false
|
|
156
|
+
end
|
|
157
|
+
|
|
132
158
|
function InputModeServiceClient:Destroy()
|
|
133
159
|
self._maid:DoCleaning()
|
|
134
160
|
end
|