new shortcuts

* Ctrl+Q logout from game
* Ctrl+Shift+R reload scripts, instead of Ctrl+R that is now reserved for rule report
* Ctrl+A clean the chat text box
* Ctrl+F toggles fullscreen mode
This commit is contained in:
Eduardo Bart 2012-04-24 09:14:03 -03:00
parent efd17361f8
commit 7526315d12
4 changed files with 8 additions and 1 deletions

View File

@ -24,6 +24,7 @@ function Options.init()
end end
Keyboard.bindKeyDown('Ctrl+P', Options.toggle) Keyboard.bindKeyDown('Ctrl+P', Options.toggle)
Keyboard.bindKeyDown('Ctrl+F', function() Options.toggleOption('fullscreen') end)
optionsWindow = displayUI('options.otui') optionsWindow = displayUI('options.otui')
optionsWindow:hide() optionsWindow:hide()
@ -66,6 +67,10 @@ function Options.openWebpage()
displayErrorBox("Error", "Not implemented yet") displayErrorBox("Error", "Not implemented yet")
end end
function Options.toggleOption(key)
Options.setOption(key, not Options.getOption(key))
end
function Options.setOption(key, value) function Options.setOption(key, value)
if key == 'vsync' then if key == 'vsync' then
g_window.setVerticalSync(value) g_window.setVerticalSync(value)

View File

@ -51,6 +51,7 @@ function GameInterface.init()
Keyboard.bindKeyPress('Escape', function() g_game.cancelAttackAndFollow() end, gameRootPanel, WALK_AUTO_REPEAT_DELAY) Keyboard.bindKeyPress('Escape', function() g_game.cancelAttackAndFollow() end, gameRootPanel, WALK_AUTO_REPEAT_DELAY)
Keyboard.bindKeyPress('Ctrl+=', function() gameMapPanel:zoomIn() end, gameRootPanel, 250) Keyboard.bindKeyPress('Ctrl+=', function() gameMapPanel:zoomIn() end, gameRootPanel, 250)
Keyboard.bindKeyPress('Ctrl+-', function() gameMapPanel:zoomOut() end, gameRootPanel, 250) Keyboard.bindKeyPress('Ctrl+-', function() gameMapPanel:zoomOut() end, gameRootPanel, 250)
Keyboard.bindKeyDown('Ctrl+Q', GameInterface.tryLogout, gameRootPanel)
if g_game.isOnline() then if g_game.isOnline() then
GameInterface.show() GameInterface.show()

View File

@ -202,6 +202,7 @@ function Console.init()
Keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() end, consolePanel) Keyboard.bindKeyPress('Tab', function() consoleTabBar:selectNextTab() end, consolePanel)
Keyboard.bindKeyPress('Shift+Tab', function() consoleTabBar:selectPrevTab() end, consolePanel) Keyboard.bindKeyPress('Shift+Tab', function() consoleTabBar:selectPrevTab() end, consolePanel)
Keyboard.bindKeyDown('Enter', Console.sendCurrentMessage, consolePanel) Keyboard.bindKeyDown('Enter', Console.sendCurrentMessage, consolePanel)
Keyboard.bindKeyPress('Ctrl+A', function() consoleTextEdit:clearText() end, consolePanel)
-- apply buttom functions after loaded -- apply buttom functions after loaded
consolePanel:getChildById('nextChannelButton').onClick = function() consoleTabBar:selectNextTab() end consolePanel:getChildById('nextChannelButton').onClick = function() consoleTabBar:selectNextTab() end

View File

@ -1,4 +1,4 @@
-- this file is loaded after all modules are loaded and initialized -- this file is loaded after all modules are loaded and initialized
-- you can place any custom user code here -- you can place any custom user code here
Keyboard.bindKeyDown('Ctrl+R', Client.reloadScripts) Keyboard.bindKeyDown('Ctrl+Shift+R', Client.reloadScripts)