refactor: removed unnecessary input reading code
This commit is contained in:
parent
59a3d96b5b
commit
5d2da3ddbf
1 changed files with 1 additions and 7 deletions
|
@ -7,13 +7,7 @@
|
|||
|
||||
public void UpdateInput() {
|
||||
_wasPressed = _isPressed;
|
||||
short keyState = Win32API.GetAsyncKeyState(Key);
|
||||
|
||||
if (_wasPressed && keyState == 0) {
|
||||
_isPressed = false;
|
||||
}else if (!_isPressed && keyState != 0) {
|
||||
_isPressed = true;
|
||||
}
|
||||
_isPressed = Win32API.GetAsyncKeyState(Key) != 0;
|
||||
}
|
||||
|
||||
public bool KeyDown() => _isPressed && !_wasPressed;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue