Fixed cancel: both
parent
f9c7aa403e
commit
b4506bda77
|
@ -29,8 +29,20 @@ default:
|
|||
condition: mouse4
|
||||
cancel: both
|
||||
type: hold
|
||||
primary: +class_action
|
||||
secondary: +reload
|
||||
primary: +reload
|
||||
secondary: +class_action
|
||||
# class action is something useful for each class,
|
||||
# like destroying and rebuilding a sentry for the engineer
|
||||
# this is just the default. I do a lot of hybridknight and
|
||||
# mantread soldier so having a melee/main weapon switch bind
|
||||
# is useful
|
||||
hold class_action:
|
||||
alias: yes
|
||||
press:
|
||||
- "slot3"
|
||||
- "wait 10"
|
||||
- "slot1"
|
||||
release: ""
|
||||
|
||||
# other
|
||||
impulse =: kill
|
||||
|
@ -82,18 +94,6 @@ default:
|
|||
impulse maybe_move_right:
|
||||
alias: yes
|
||||
command: ""
|
||||
# class action is something useful for each class,
|
||||
# like destroying and rebuilding a sentry for the engineer
|
||||
# this is just the default. I do a lot of hybridknight and
|
||||
# mantread soldier so having a melee/main weapon switch bind
|
||||
# is useful
|
||||
hold class_action:
|
||||
alias: yes
|
||||
press:
|
||||
- "slot3"
|
||||
- "wait 10"
|
||||
- "slot1"
|
||||
release: ""
|
||||
|
||||
impulse load0:
|
||||
alias: yes
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import re
|
||||
|
||||
validKeyList = [
|
||||
# top row
|
||||
'escape', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10', 'f11', 'f12',
|
||||
|
@ -284,12 +282,16 @@ class Hold(Bind):
|
|||
if self.alias:
|
||||
# if alias, do this to avoid activating
|
||||
# and never deactivating
|
||||
minuskey = '-' + self.key
|
||||
self.key = '+' + self.key
|
||||
|
||||
return (
|
||||
code = (
|
||||
pressStr + releaseStr
|
||||
+ f'{bindOrAlias} {self.key} "+{holdStr}"\n'
|
||||
)
|
||||
if self.alias:
|
||||
code += f'alias {minuskey} "-{holdStr}"\n'
|
||||
return code
|
||||
|
||||
|
||||
class Toggle(Bind):
|
||||
|
@ -470,8 +472,8 @@ class Double(Bind):
|
|||
mainCode, altCode = self.getCancelCode(mainCode, altCode)
|
||||
|
||||
if self.type == 'hold':
|
||||
self.primStr = '+' + self.primStr
|
||||
self.secondStr = '+' + self.secondStr
|
||||
self.primStr = '+hold_' + self.primStr
|
||||
self.secondStr = '+hold_' + self.secondStr
|
||||
|
||||
shiftStr = f'shift_{self.key}'
|
||||
shiftCode = self.getChangeCode(shiftStr)
|
||||
|
@ -525,11 +527,13 @@ class Double(Bind):
|
|||
|
||||
mainLines = mainCode.splitlines()
|
||||
mainMinusLine = mainLines[1]
|
||||
mainMinusName = mainMinusLine.split(' ')[1]
|
||||
# second arg, without first or last quote
|
||||
mainMinusStr = mainMinusLine.split(' ', 2)[2][1:-1]
|
||||
|
||||
altLines = altCode.splitlines()
|
||||
altMinusLine = altLines[1]
|
||||
altMinusName = altMinusLine.split(' ')[1]
|
||||
# same as above
|
||||
altMinusStr = altMinusLine.split(' ', 2)[2][1:-1]
|
||||
|
||||
|
@ -539,8 +543,12 @@ class Double(Bind):
|
|||
allCancels = mainMinusSet | altMinusSet
|
||||
allCancelStr = ';'.join(allCancels)
|
||||
|
||||
altLines[1] = altLines[1][:-1] + f';{allCancelStr}"'
|
||||
mainLines[1] = mainLines[1][:-1] + f';{allCancelStr}"'
|
||||
altMinusLineStart = ' '.join(altMinusLine.split(' ')[:2])
|
||||
altLines[1] = altMinusLineStart + f' "{allCancelStr}"'
|
||||
altLines.insert(3, f'alias -{self.secondStr} "{altMinusName}"')
|
||||
mainMinusLineStart = ' '.join(mainMinusLine.split(' ')[:2])
|
||||
mainLines[1] = mainMinusLineStart + f' "{allCancelStr}"'
|
||||
mainLines.insert(3, f'alias -{self.primStr} "{mainMinusName}"')
|
||||
|
||||
return (
|
||||
'\n'.join(mainLines) + '\n',
|
||||
|
|
Loading…
Reference in New Issue