@@ -59,6 +59,7 @@ defaults.ResetKey = '`'
5959defaults .BackKey = ' backspace'
6060defaults .Verbose = false
6161defaults .VerboseOutput = ' Text'
62+ defaults .VerboseKeys = false
6263defaults .Label = {}
6364
6465settings = config .load (defaults )
@@ -67,20 +68,32 @@ label = texts.new(settings.Label, settings)
6768
6869binds = {}
6970names = {}
71+ key_combos = {}
7072current = binds
7173stack = L {binds }
7274keys = S {}
7375
7476output = function ()
7577 if settings .Verbose then
76- names [current ] = names [current ] or ' Unnamed ' .. tostring (current ):sub (8 )
78+ names [current ] = names [current ] or ' Unnamed'
79+
80+ local output_text_names = L {}
81+ output_text_names :append (names [current ])
82+ if settings .VerboseKeys then
83+ for key , val in pairs (current ) do
84+ if type (val ) ~= ' string' then
85+ val = names [val ] or ' Unnamed'
86+ end
87+ output_text_names :append (key_combos [key ] .. ' : ' .. val )
88+ end
89+ end
7790
7891 if settings .VerboseOutput == ' Text' then
79- label :text (names [ current ] )
92+ label :text (output_text_names : concat ( ' \n ' ) )
8093 elseif settings .VerboseOutput == ' Chat' then
81- log (' Changing into macro set %s.' :format (names [ current ] ))
94+ log (' Changing into macro set %s.' :format (output_text_names : concat ( ' | ' ) ))
8295 elseif settings .VerboseOutput == ' Console' then
83- print (' Changing into macro set %s.' :format (names [ current ] ))
96+ print (' Changing into macro set %s.' :format (output_text_names : concat ( ' | ' ) ))
8497 end
8598 end
8699end
@@ -127,12 +140,13 @@ parse_binds = function(fbinds, top)
127140
128141 rawset (names , top , rawget (_innerG ._names , fbinds ))
129142 for key , val in pairs (fbinds ) do
130- key = S (key :split (' +' )):map (string.lower )
143+ local split_key = S (key :split (' +' )):map (string.lower )
144+ rawset (key_combos , split_key , key )
131145 if type (val ) == ' string' or type (val ) == ' function' then
132- rawset (top , key , val )
146+ rawset (top , split_key , val )
133147 else
134148 local sub = {}
135- rawset (top , key , sub )
149+ rawset (top , split_key , sub )
136150 parse_binds (val , sub )
137151 end
138152 end
0 commit comments