GenerateKeyMap() now changes KEY_MAP according to the config file
This commit is contained in:
parent
3492ec9349
commit
0fa68fe7b0
@ -37,7 +37,15 @@ func ReadConfig() {
|
|||||||
|
|
||||||
func GenerateKeyMap(funcMap map[string]func()) {
|
func GenerateKeyMap(funcMap map[string]func()) {
|
||||||
for k := range funcMap {
|
for k := range funcMap {
|
||||||
fmt.Println(k, " : ", viper.GetStringSlice(k))
|
mappingsForFunctionK := viper.GetStringSlice(k)
|
||||||
|
if len(mappingsForFunctionK) != 0 {
|
||||||
|
for _, i := range mappingsForFunctionK {
|
||||||
|
aV, err := GetAsciiValue(i)
|
||||||
|
if err == nil {
|
||||||
|
KEY_MAP[aV] = k
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user