This commit is contained in:
Eduardo Bart 2013-01-27 18:26:20 -02:00
parent 6966221e39
commit 4536c68f00
3 changed files with 19 additions and 15 deletions

View File

@ -496,11 +496,9 @@ function addTabText(text, speaktype, tab, creatureName)
end
label.name = creatureName
if creatureName and #creatureName > 0 then
label.onMouseRelease = function (self, mousePos, mouseButton)
processMessageMenu(mousePos, mouseButton, creatureName, text, self, tab)
end
end
if consoleBuffer:getChildCount() > MAX_LINES then
consoleBuffer:getFirstChild():destroy()
@ -542,7 +540,7 @@ end
function processMessageMenu(mousePos, mouseButton, creatureName, text, label, tab)
if mouseButton == MouseRightButton then
local menu = g_ui.createWidget('PopupMenu')
if creatureName then
if creatureName and #creatureName > 0 then
if creatureName ~= g_game.getCharacterName() then
menu:addOption(tr('Message to ' .. creatureName), function () g_game.openPrivateChannel(creatureName) end)
if not g_game.getLocalPlayer():hasVip(creatureName) then

View File

@ -117,6 +117,11 @@ void PlatformWindow::processKeyUp(Fw::Key keyCode)
} else if(keyCode == Fw::KeyShift) {
m_inputEvent.keyboardModifiers &= ~Fw::KeyboardShiftModifier;
return;
} else if(keyCode == Fw::KeyNumLock) {
for(uchar k = Fw::KeyNumpad0; k <= Fw::KeyNumpad9; ++k) {
if(m_keysState[(Fw::Key)k])
processKeyUp((Fw::Key)k);
}
}
if(!m_keysState[keyCode])

View File

@ -510,28 +510,29 @@ Fw::Key WIN32Window::retranslateVirtualKey(WPARAM wParam, LPARAM lParam)
// lParam will have this state when receiving insert,end,down,etc presses from numpad
if(!(((HIWORD(lParam) >> 8) & 0xFF) & 1)) {
bool numlockOn = GetKeyState(VK_NUMLOCK);
// retranslate numpad keys
switch(wParam) {
case VK_INSERT:
return Fw::KeyNumpad0;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad0;
case VK_END:
return Fw::KeyNumpad1;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad1;
case VK_DOWN:
return Fw::KeyNumpad2;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad2;
case VK_NEXT:
return Fw::KeyNumpad3;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad3;
case VK_LEFT:
return Fw::KeyNumpad4;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad4;
case VK_CLEAR:
return Fw::KeyNumpad5;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad5;
case VK_RIGHT:
return Fw::KeyNumpad6;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad6;
case VK_HOME:
return Fw::KeyNumpad7;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad7;
case VK_UP:
return Fw::KeyNumpad8;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad8;
case VK_PRIOR:
return Fw::KeyNumpad9;
return numlockOn ? Fw::KeyUnknown : Fw::KeyNumpad9;
}
}