TASmod icon indicating copy to clipboard operation
TASmod copied to clipboard

Add subtick ability to keyboard (Similar to mouse paths)

Open ScribbleTAS opened this issue 2 years ago • 0 comments

I was made aware that the keyaboard can perform subtick inputs as well, similar to the mouse.

This is only really useful in guiscreens when using the keyboard to switch hotbar positions.

This also fixes the issue of having to hold certain keys for an input to be registered in low tickrates for example.

  • [ ] ~~Increase tasfile version to 2~~ Make TASFile versions strings.
  • [x] Add unit tests to Virtual Input

New syntax

After thinking about this for a while, I should probably introduce a new syntax for proper subtick handling

Current

55|Keyboard:W,LCONTROL;w|Mouse:;[MOUSEMOVED,0,887,626]->[RC,0,1580,658]->[MOUSEMOVED,0,1580,658]|Camera:17.85;-202.74799~&

Subticks are stored in square brackets. ([MOUSEMOVED,0,887,626]->[RC,0,1580,658] etc...). This looks just very messy

Proposal

55|Keyboard:W,LCONTROL;w|Mouse:;0,887,626|Camera:17.85;-202.74799
	1|Keyboard:|Mouse:RC;0,1580,658|Camera:17.85;-202.74799
	2|Keyboard:|Mouse:;0,1580,658|Camera:17.85;-202.74799

The non indented lines are for ticks, while the indented lines are for subticks.

This way, we can support Mouse and Keyboard subticks, as well as Camera subticks while we are at it.
This also gets rid of the square bracket syntax.
We can also use the existing comparing system for ticks to also check for subticks and maybe add monitoring and control bytes for subtick commands. And this system is upgradable, the old syntax can be converted into the new one.

ScribbleTAS avatar May 07 '23 12:05 ScribbleTAS