Skip to content
Snippets Groups Projects
Commit 9d053339 authored by dg's avatar dg
Browse files

test

git-svn-id: http://svn.net-core.org/repos/t-engine4@2788 51575b47-30f0-44d4-a5cc-537603b46e54
parent 162f38a6
No related branches found
No related tags found
No related merge requests found
......@@ -192,7 +192,7 @@ function _M:receiveKey(sym, ctrl, shift, alt, meta, unicode, isup, ismouse)
local ks, us
if not ismouse then ks, us = self:makeKeyString(sym, ctrl, shift, alt, meta, unicode)
else ks = self:makeMouseString(sym, ctrl, shift, alt, meta) end
-- print("[BIND]", sym, ctrl, shift, alt, meta, unicode, " :=: ", ks, us, " ?=? ", self.binds[ks], us and self.binds[us])
print("[BIND]", sym, ctrl, shift, alt, meta, unicode, " :=: ", ks, us, " ?=? ", self.binds[ks], us and self.binds[us])
if self.binds[ks] and self.virtuals[self.binds[ks]] then
if isup and not _M.binds_def[self.binds[ks]].updown then return end
self.virtuals[self.binds[ks]](sym, ctrl, shift, alt, meta, unicode, isup)
......
......@@ -918,10 +918,8 @@ function _M:setupCommands()
HOTKEY_THIRD_10 = not_wild(function() self.player:activateHotkey(34) end),
HOTKEY_THIRD_11 = not_wild(function() self.player:activateHotkey(35) end),
HOTKEY_THIRD_12 = not_wild(function() self.player:activateHotkey(36) end),
HOTKEY_PREV_PAGE = not_wild(function() self.player:prevHotkeyPage() self.log("Hotkey page %d is now displayed.", self.player.hotkey_page) end),
HOTKEY_NEXT_PAGE = not_wild(function() self.player:nextHotkeyPage() self.log("Hotkey page %d is now displayed.", self.player.hotkey_page) end),
-- HOTKEY_HOTPAGE2 = function(sym, ctrl, shift, alt, meta, unicode, isup) self.player:setHotkeyPage(isup and 1 or 2) end,
-- HOTKEY_HOTPAGE3 = function(sym, ctrl, shift, alt, meta, unicode, isup) self.player:setHotkeyPage(isup and 1 or 3) end,
-- HOTKEY_PREV_PAGE = not_wild(function() self.player:prevHotkeyPage() self.log("Hotkey page %d is now displayed.", self.player.hotkey_page) end),
-- HOTKEY_NEXT_PAGE = not_wild(function() self.player:nextHotkeyPage() self.log("Hotkey page %d is now displayed.", self.player.hotkey_page) end),
-- Party commands
SWITCH_PARTY_1 = not_wild(function() self.party:select(1) end),
......
......@@ -224,6 +224,13 @@ void on_event(SDL_Event *event)
lua_remove(L, -2);
lua_rawgeti(L, LUA_REGISTRYINDEX, current_keyhandler);
lua_pushnumber(L, event->key.keysym.sym);
/*
Uint8 *_pKeyState = SDL_GetKeyState(NULL);
lua_pushboolean(L, (_pKeyState[SDLK_RCTRL] || _pKeyState[SDLK_LCTRL]) ? TRUE : FALSE);
lua_pushboolean(L, (_pKeyState[SDLK_RSHIFT] || _pKeyState[SDLK_LSHIFT]) ? TRUE : FALSE);
lua_pushboolean(L, (_pKeyState[SDLK_RALT] || _pKeyState[SDLK_LALT]) ? TRUE : FALSE);
lua_pushboolean(L, (_pKeyState[SDLK_RMETA] || _pKeyState[SDLK_LMETA]) ? TRUE : FALSE);
*/
lua_pushboolean(L, (event->key.keysym.mod & KMOD_CTRL) ? TRUE : FALSE);
lua_pushboolean(L, (event->key.keysym.mod & KMOD_SHIFT) ? TRUE : FALSE);
lua_pushboolean(L, (event->key.keysym.mod & KMOD_ALT) ? TRUE : FALSE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment