mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-31 14:43:42 +00:00
WINTERMUTE: Rename FuncName/VarName -> funcName/varName in BKeyboardState
This commit is contained in:
parent
7a40ed2446
commit
63ad1c9b9b
@ -3791,7 +3791,7 @@ bool CBGame::handleKeypress(Common::Event *event, bool printable) {
|
||||
|
||||
|
||||
_keyboardState->handleKeyPress(event);
|
||||
_keyboardState->ReadKey(event);
|
||||
_keyboardState->readKey(event);
|
||||
// TODO
|
||||
|
||||
if (_focusedWindow) {
|
||||
|
@ -92,7 +92,7 @@ HRESULT CBKeyboardState::scCallMethod(CScScript *script, CScStack *stack, CScSta
|
||||
warning("BKeyboardState doesnt yet have state-support %d", vKey); //TODO;
|
||||
// Uint8 *state = SDL_GetKeyboardState(NULL);
|
||||
// SDL_Scancode scanCode = SDL_GetScancodeFromKey(VKeyToKeyCode(vKey));
|
||||
bool isDown = _keyStates[VKeyToKeyCode(vKey)];
|
||||
bool isDown = _keyStates[vKeyToKeyCode(vKey)];
|
||||
|
||||
stack->pushBool(isDown);
|
||||
return S_OK;
|
||||
@ -195,9 +195,9 @@ const char *CBKeyboardState::scToString() {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
HRESULT CBKeyboardState::ReadKey(Common::Event *event) {
|
||||
HRESULT CBKeyboardState::readKey(Common::Event *event) {
|
||||
//_currentPrintable = (event->type == SDL_TEXTINPUT); // TODO
|
||||
_currentCharCode = KeyCodeToVKey(event);
|
||||
_currentCharCode = keyCodeToVKey(event);
|
||||
if ((_currentCharCode <= Common::KEYCODE_z && _currentCharCode >= Common::KEYCODE_a) ||
|
||||
(_currentCharCode <= Common::KEYCODE_9 && _currentCharCode >= Common::KEYCODE_0)) {
|
||||
_currentPrintable = true;
|
||||
@ -206,9 +206,9 @@ HRESULT CBKeyboardState::ReadKey(Common::Event *event) {
|
||||
}
|
||||
//_currentKeyData = KeyData;
|
||||
|
||||
_currentControl = IsControlDown();
|
||||
_currentAlt = IsAltDown();
|
||||
_currentShift = IsShiftDown();
|
||||
_currentControl = isControlDown();
|
||||
_currentAlt = isAltDown();
|
||||
_currentShift = isShiftDown();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@ -237,25 +237,25 @@ HRESULT CBKeyboardState::persist(CBPersistMgr *persistMgr) {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CBKeyboardState::IsShiftDown() {
|
||||
bool CBKeyboardState::isShiftDown() {
|
||||
int mod = g_system->getEventManager()->getModifierState();
|
||||
return (mod & Common::KBD_SHIFT);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CBKeyboardState::IsControlDown() {
|
||||
bool CBKeyboardState::isControlDown() {
|
||||
int mod = g_system->getEventManager()->getModifierState();
|
||||
return (mod & Common::KBD_CTRL);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
bool CBKeyboardState::IsAltDown() {
|
||||
bool CBKeyboardState::isAltDown() {
|
||||
int mod = g_system->getEventManager()->getModifierState();
|
||||
return (mod & Common::KBD_ALT);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
uint32 CBKeyboardState::KeyCodeToVKey(Common::Event *event) {
|
||||
uint32 CBKeyboardState::keyCodeToVKey(Common::Event *event) {
|
||||
if (event->type != Common::EVENT_KEYDOWN) return 0;
|
||||
|
||||
switch (event->kbd.keycode) {
|
||||
@ -267,7 +267,7 @@ uint32 CBKeyboardState::KeyCodeToVKey(Common::Event *event) {
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
Common::KeyCode CBKeyboardState::VKeyToKeyCode(uint32 vkey) {
|
||||
Common::KeyCode CBKeyboardState::vKeyToKeyCode(uint32 vkey) {
|
||||
// todo
|
||||
return (Common::KeyCode)vkey;
|
||||
}
|
||||
|
@ -50,13 +50,13 @@ public:
|
||||
DECLARE_PERSISTENT(CBKeyboardState, CBScriptable)
|
||||
CBKeyboardState(CBGame *inGame);
|
||||
virtual ~CBKeyboardState();
|
||||
HRESULT ReadKey(Common::Event *event);
|
||||
HRESULT readKey(Common::Event *event);
|
||||
|
||||
void handleKeyPress(Common::Event *event);
|
||||
void handleKeyRelease(Common::Event *event);
|
||||
static bool IsShiftDown();
|
||||
static bool IsControlDown();
|
||||
static bool IsAltDown();
|
||||
static bool isShiftDown();
|
||||
static bool isControlDown();
|
||||
static bool isAltDown();
|
||||
|
||||
// scripting interface
|
||||
virtual CScValue *scGetProperty(const char *name);
|
||||
@ -66,8 +66,8 @@ public:
|
||||
|
||||
private:
|
||||
uint8 *_keyStates;
|
||||
uint32 KeyCodeToVKey(Common::Event *event);
|
||||
Common::KeyCode VKeyToKeyCode(uint32 vkey); //TODO, reimplement using ScummVM-backend
|
||||
uint32 keyCodeToVKey(Common::Event *event);
|
||||
Common::KeyCode vKeyToKeyCode(uint32 vkey); //TODO, reimplement using ScummVM-backend
|
||||
};
|
||||
|
||||
} // end of namespace WinterMute
|
||||
|
@ -698,7 +698,7 @@ bool CUIEdit::handleKeypress(Common::Event *event, bool printable) {
|
||||
|
||||
// ctrl+A
|
||||
case Common::KEYCODE_a:
|
||||
if (CBKeyboardState::IsControlDown()) {
|
||||
if (CBKeyboardState::isControlDown()) {
|
||||
_selStart = 0;
|
||||
_selEnd = strlen(_text);
|
||||
Handled = true;
|
||||
@ -719,24 +719,24 @@ bool CUIEdit::handleKeypress(Common::Event *event, bool printable) {
|
||||
case Common::KEYCODE_LEFT:
|
||||
case Common::KEYCODE_UP:
|
||||
_selEnd--;
|
||||
if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
|
||||
if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd;
|
||||
Handled = true;
|
||||
break;
|
||||
|
||||
case Common::KEYCODE_RIGHT:
|
||||
case Common::KEYCODE_DOWN:
|
||||
_selEnd++;
|
||||
if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
|
||||
if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd;
|
||||
Handled = true;
|
||||
break;
|
||||
|
||||
case Common::KEYCODE_HOME:
|
||||
if (Game->_textRTL) {
|
||||
_selEnd = strlen(_text);
|
||||
if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
|
||||
if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd;
|
||||
} else {
|
||||
_selEnd = 0;
|
||||
if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
|
||||
if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd;
|
||||
}
|
||||
Handled = true;
|
||||
break;
|
||||
@ -744,10 +744,10 @@ bool CUIEdit::handleKeypress(Common::Event *event, bool printable) {
|
||||
case Common::KEYCODE_END:
|
||||
if (Game->_textRTL) {
|
||||
_selEnd = 0;
|
||||
if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
|
||||
if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd;
|
||||
} else {
|
||||
_selEnd = strlen(_text);
|
||||
if (!CBKeyboardState::IsShiftDown()) _selStart = _selEnd;
|
||||
if (!CBKeyboardState::isShiftDown()) _selStart = _selEnd;
|
||||
}
|
||||
Handled = true;
|
||||
break;
|
||||
|
@ -1103,7 +1103,7 @@ const char *CUIWindow::scToString() {
|
||||
bool CUIWindow::handleKeypress(Common::Event *event, bool printable) {
|
||||
//TODO
|
||||
if (event->type == Common::EVENT_KEYDOWN && event->kbd.keycode == Common::KEYCODE_TAB) {
|
||||
return SUCCEEDED(moveFocus(!CBKeyboardState::IsShiftDown()));
|
||||
return SUCCEEDED(moveFocus(!CBKeyboardState::isShiftDown()));
|
||||
} else {
|
||||
if (_focusedWidget) return _focusedWidget->handleKeypress(event, printable);
|
||||
else return false;
|
||||
|
Loading…
Reference in New Issue
Block a user