Skip to content

Commit

Permalink
Use inputfilter functions for shift/ctrl pressed status
Browse files Browse the repository at this point in the history
In inputhandler applykeymodifiers for kb
  • Loading branch information
TheROPFather committed Jun 24, 2018
1 parent d60f79e commit 3c5349a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/arch/InputHandler/InputHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,9 @@ void InputHandler::ButtonPressed( DeviceInput di )

wchar_t InputHandler::ApplyKeyModifiers(wchar_t c)
{
bool bHoldingShift =
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT)) ||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT));
bool bHoldingShift = INPUTFILTER->IsShiftPressed();

bool bHoldingCtrl =
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) ||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL));
bool bHoldingCtrl = INPUTFILTER->IsControlPressed();

// todo: handle Caps Lock -freem
if( bHoldingShift && !bHoldingCtrl )
Expand Down

0 comments on commit 3c5349a

Please sign in to comment.