Skip to content

Commit

Permalink
Fix #119: Updated the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tamilarasi-t12 committed Dec 5, 2024
1 parent 3a01255 commit 9f58795
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions framework/core/commonRemote.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def getMappedKey(self, key:str):
prefix = self.currentMap.get("prefix")
returnedKey=self.currentMap["codes"].get(key)
if prefix:
returnedKey = prefix + returnedKey
returnedKey = prefix + key
return returnedKey

def getKeyMap(self):
Expand Down Expand Up @@ -153,7 +153,15 @@ def __decodeRemoteMapConfig(self):
with open(configFile) as inputFile:
inputFile.seek(0, os.SEEK_SET)
config = yaml.full_load(inputFile)
return config.get("remoteMaps", [])
keyDictionary = {}
for key, val in config.items():
if isinstance(val, dict):
for k, v in val.items():
keyDictionary[k] = v
else:
keyDictionary[key] = val

return keyDictionary.get("remoteMaps")

def sendKey(self, keycode:dict, delay:int=1, repeat:int=1, randomRepeat:int=0):
"""Send a key to the remoteCommander
Expand Down Expand Up @@ -188,4 +196,4 @@ def setKeyMap( self, name:dict ):
def getKeyMap( self ):
"""Get the Key Translation Map
"""
return self.remoteMap.getKeyMap()
self.remoteMap.getKeyMap()

0 comments on commit 9f58795

Please sign in to comment.