Now starts outputting to files
parent
ef4fe2a49e
commit
faa6f4a3bf
39
tfscript.py
39
tfscript.py
|
@ -5,7 +5,7 @@ def makeCFG(cfg):
|
|||
# I know all of these fields exist because it was verified in verify.py
|
||||
bindType = firstTypeIn(data.keys())
|
||||
bindContent = data[bindType]
|
||||
ret += branch(key, bindType, bindContent)
|
||||
ret += branch(key, bindContent, bindType)
|
||||
|
||||
return ret
|
||||
|
||||
|
@ -15,11 +15,42 @@ def firstTypeIn(inputList):
|
|||
"impulse",
|
||||
"hold",
|
||||
"toggle",
|
||||
"double"
|
||||
"double",
|
||||
"repeat"
|
||||
]
|
||||
for e in types:
|
||||
if e in inputList:
|
||||
return e
|
||||
|
||||
def branch(keyName, bindType, bindContent):
|
||||
return f'placeholder for {keyName}\n'
|
||||
def branch(keyName, bindContent, bindType):
|
||||
if bindType == "impulse":
|
||||
return impulse(keyName, bindContent)
|
||||
elif bindType == "hold":
|
||||
if isinstance(bindContent, str):
|
||||
return simpleHold(keyName, bindContent)
|
||||
else:
|
||||
return listHold(keyName, bindContent)
|
||||
elif bindType == "toggle":
|
||||
return toggle(keyName, bindContent)
|
||||
elif bindType == "double":
|
||||
return double(keyName, bindContent)
|
||||
elif bindType == "repeat":
|
||||
return repeat(keyName, bindContent)
|
||||
|
||||
def impulse(key, instruction):
|
||||
return f'bind {key} {instruction}\n'
|
||||
|
||||
def simpleHold(key, instruction):
|
||||
return f'placeholder for {key} (single instruction hold)\n'
|
||||
|
||||
def listHold(key, options):
|
||||
return f'placeholder for {key} (press and release hold)\n'
|
||||
|
||||
def toggle(key, options):
|
||||
return f'placeholder for {key} (toggle)\n'
|
||||
|
||||
def double(key, options):
|
||||
return f'placeholder for {key} (double)\n'
|
||||
|
||||
def repeat(key, options):
|
||||
return f'placeholder for {key} (repeat)\n'
|
||||
|
|
Loading…
Reference in New Issue