1 -- Authors: Etan Reisner <deryni@gmail.com>
2 -- License: MIT, see http://opensource.org/licenses/mit-license.php
3 -- Last Changed: 2007-07-04
7 Email: deryni@unreliablesource.net
8 Summary: Displays an infowin with the currently active submap.
10 Last Updated: 2007-07-04
12 Copyright (c) Etan Reisner 2007.
14 This software is released under the terms of the MIT license. For more
15 information, see http://opensource.org/licenses/mit-license.php .
18 local sswins
= setmetatable({}, {__mode
="kv"})
20 local function sswin_set_hidden(sswin
, state
)
25 local mgr
= ioncore
.find_manager(sswin
, "WScreen")
26 mgr
:set_hidden(sswin
, state
)
29 function show_submap_win(reg
, keystr
)
34 ioncore
.defer(function()
36 sswin
= scr
:attach_new({
38 name
="show_submap_iw"..scr
:id(),
42 geom
={x
=0, y
=0, w
=1, h
=1},
47 sswin_set_hidden(sswin
, "unset")
48 sswin
:set_text(keystr
or "", -1)
52 function hide_submap_win()
53 local scr
= ioncore
.current():screen_of()
54 sswin_set_hidden(sswins
[scr
], "set")
58 local hook
= ioncore
.get_hook("ioncore_submap_ungrab_hook")
61 hook
:add(hide_submap_win
)
64 for section
, bindings
in pairs(ioncore
.getbindings()) do
65 for _
,binds
in pairs(bindings
) do
67 defbindings(section
, {submap(binds
.kcb
, {submap_enter("show_submap_win(_, '"..binds
.kcb
.."')")})})
75 -- vim: set sw=4 sts=4 et: