Skip to content

Commit

Permalink
change polarity of HID keyboard keys
Browse files Browse the repository at this point in the history
  • Loading branch information
ctacke committed Nov 17, 2024
1 parent 586df28 commit 40b2314
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public DisplayScreen(IPixelDisplay physicalDisplay, RotationType rotation = Rota

if (TouchScreen != null)
{
TouchScreen.TouchDown += _touchScreen_TouchDown;
TouchScreen.TouchUp += _touchScreen_TouchUp;
TouchScreen.TouchDown += OnTouchDown;
TouchScreen.TouchUp += OnTouchUp;
}

if (theme?.Font != null)
Expand Down Expand Up @@ -97,7 +97,7 @@ public Color BackgroundColor
}
}

private void _touchScreen_TouchUp(ITouchScreen source, TouchPoint point)
private void OnTouchUp(ITouchScreen source, TouchPoint point)
{
bool LookForUnclick(ControlsCollection controls)
{
Expand Down Expand Up @@ -128,7 +128,7 @@ bool LookForUnclick(ControlsCollection controls)
}
}

private void _touchScreen_TouchDown(ITouchScreen source, TouchPoint point)
private void OnTouchDown(ITouchScreen source, TouchPoint point)
{
bool LookForClick(ControlsCollection controls)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private void MacKeyScanner()
{
var state = InteropMac.CGEventSourceKeyState(
InteropMac.CGEventSourceStateID.hidSystemState,
keycode.Value) != 0;
keycode.Value) == 0;

key.Value.SetState(state);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ private void WindowsKeyScanner()
if ((state & 0x8000) != 0)
{
// key is currently down
key.Value.SetState(true);
key.Value.SetState(false);
}
else if ((state & 0x0001) != 0)
{
// state was down since last call (is now up)
key.Value.SetState(true);
key.Value.SetState(false);
key.Value.SetState(true);
}
else
{
key.Value.SetState(false);
key.Value.SetState(true);
}

}
Expand Down

0 comments on commit 40b2314

Please sign in to comment.