If you place this script in "C:\Program Files (x86)\Steam\Steamapps\common\Leadwerks\Scripts\Start\CustomShortcuts.lua", this will provide you with one possible way of overriding shortcut keys that are generated dynancally. You can switch between the translate, rotate, and scale tools using T, R, and G.
You can get to the folder faster by selecting the Scripting > Open Scripts Folder menu item.
You could change this to match Blender's keys, if you want, but I did not because we use WASD for camera movement.
Version 5.0.1 beta is required (it will go up today) for the textfield check to work. This will ignore key input when a textfield is selected.
function Callback(event)
if event.id == EVENT_KEYDOWN then
if isfunction(program.ui.GetFocus) then
--[[Requires 5.0.1 for this check to work]]
local widget = program.ui:GetFocus()
if widget ~= nil then
if TextField(widget) then return end
end
end
if event.data == KEY_T then
local menu = program.menu:FindChild("Translate", true)
if menu ~= nil then
EmitEvent(EVENT_WIDGETACTION, menu)
end
elseif event.data == KEY_R then
local menu = program.menu:FindChild("Rotate", true)
if menu ~= nil then
EmitEvent(EVENT_WIDGETACTION, menu)
end
elseif event.data == KEY_G then
local menu = program.menu:FindChild("Scale", true)
if menu ~= nil then
EmitEvent(EVENT_WIDGETACTION, menu)
end
end
end
end
ListenEvent(EVENT_KEYDOWN, program.window, Callback)