Insert Command Widget
Moderator: Moderators
Insert Command Widget
I really liked this widget that was written by Tim-the-maniac. Does anyone still have it? I can't find it on any of the download sites.
-
- Posts: 22
- Joined: 04 Jun 2008, 15:48
Re: Insert Command Widget
:idea:
i dont know the widget by tim-the-maniac but i use this kool widget by jK to insert commands
just create empty lua file and insert this:
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "FrontInsert",
desc = "Allows to use the meta key to insert any command at the front of the command queue",
author = "jK",
date = "Jan,2008",
license = "GNU GPL, v2 or later",
layer = 5,
enabled = true
}
end
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
function widget:CommandNotify(id, params, options)
local _,_,meta,_ = Spring.GetModKeyState()
if (meta) then
local opt = 0
if options.alt then opt = opt + CMD.OPT_ALT end
if options.ctrl then opt = opt + CMD.OPT_CTRL end
if options.shift then opt = opt + CMD.OPT_SHIFT end
if options.right then opt = opt + CMD.OPT_RIGHT end
Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"})
return true
end
return false
end
and put the lua in ur ...\Spring\LuaUI\Widgets folder
then u just have to put this line in ur ...\Spring\uikeys.txt
"fakemeta 0x020"
to make ur spacebar the insert key

i dont know the widget by tim-the-maniac but i use this kool widget by jK to insert commands
just create empty lua file and insert this:
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "FrontInsert",
desc = "Allows to use the meta key to insert any command at the front of the command queue",
author = "jK",
date = "Jan,2008",
license = "GNU GPL, v2 or later",
layer = 5,
enabled = true
}
end
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
function widget:CommandNotify(id, params, options)
local _,_,meta,_ = Spring.GetModKeyState()
if (meta) then
local opt = 0
if options.alt then opt = opt + CMD.OPT_ALT end
if options.ctrl then opt = opt + CMD.OPT_CTRL end
if options.shift then opt = opt + CMD.OPT_SHIFT end
if options.right then opt = opt + CMD.OPT_RIGHT end
Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"})
return true
end
return false
end
and put the lua in ur ...\Spring\LuaUI\Widgets folder
then u just have to put this line in ur ...\Spring\uikeys.txt
"fakemeta 0x020"
to make ur spacebar the insert key

Re: Insert Command Widget
what does it do?fischkopf01 wrote::idea:
i dont know the widget by tim-the-maniac but i use this kool widget by jK to insert commands
just create empty lua file and insert this:
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
function widget:GetInfo()
return {
name = "FrontInsert",
desc = "Allows to use the meta key to insert any command at the front of the command queue",
author = "jK",
date = "Jan,2008",
license = "GNU GPL, v2 or later",
layer = 5,
enabled = true
}
end
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
function widget:CommandNotify(id, params, options)
local _,_,meta,_ = Spring.GetModKeyState()
if (meta) then
local opt = 0
if options.alt then opt = opt + CMD.OPT_ALT end
if options.ctrl then opt = opt + CMD.OPT_CTRL end
if options.shift then opt = opt + CMD.OPT_SHIFT end
if options.right then opt = opt + CMD.OPT_RIGHT end
Spring.GiveOrder(CMD.INSERT,{0,id,opt,unpack(params)},{"alt"})
return true
end
return false
end
and put the lua in ur ...\Spring\LuaUI\Widgets folder
then u just have to put this line in ur ...\Spring\uikeys.txt
"fakemeta 0x020"
to make ur spacebar the insert key
- FrOzEnTaCo
- Posts: 81
- Joined: 02 Jul 2008, 05:52
Re: Insert Command Widget
lol how do u create a empty lua file? thats all i need to know. 

Re: Insert Command Widget
save as something.lua with text editor (notepad or whatever).FrOzEnTaCo wrote:lol how do u create a empty lua file? thats all i need to know.
Also, use (my widget in other thread) instead. It does more stuff.