Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse Scratch Redesign #653

Merged
merged 2 commits into from Nov 3, 2021
Merged

Conversation

wcko87
Copy link
Contributor

@wcko87 wcko87 commented Oct 16, 2021

Main Issues Fixed:

  1. Improve mouse scratch algorithm (implemented as Version 2), similar to controller analog scratch
  2. Implement analog scroll using mouse
  3. Make mouse scratch usable without plugging in a controller.
  4. Split mouse scratch into horizontal and vertical axes

Improve mouse scratch algorithm

  • Old mouse scratch algorithm will fire when the mouse is moved even slightly. This is extremely sensitive and will cause input flickering, similar to old analog scratch.
  • New mouse scratch algorithm is implemented similar to the Version 2 analog scratch algorithm.

Tested on YuanCon on mouse mode (turntable controls mouse)

Implement analog scroll using mouse

  • Now mouse scratch works the same way as analog scratch in the music select menu and for lanecover adjustment

Make mouse scratch usable without plugging in a controller

  • Previously, mouse scratch was implemented in BMControllerInputProcessor.
  • This means mouse scratch cannot be used if no controller is plugged in.

Now mouse scratch is moved to a part of KeyBoardInputProcessor (processor is spelt wrong in the code).

  • I considered making mouse scratch into a separate input processor (MouseScratchInputProcessor), but I decided it was better for it to be part of KeyBoardInputProcessor.
    • This is because I don't think mouse scratch should be a separate input mode like KB, BM, MIDI (mouse scratch cannot function alone). So I think it is better for it to be considered KB input.
  • However, mouse scratch is moved into a separate class (MouseScratchInput) because it needs to have a separate set of key bindings from KeyBoardInputProcessor. MouseScratchInput is called from KeyBoardInputProcessor.
  • Mouse scratch now also has a separate configuration MouseScratchConfig, which is part of KeyboardConfig (not ControllerConfig).

Split mouse scratch into horizontal and vertical axes

  • In the old implementation of mouse scratch, there are two directions for mouse scratch. LEFT+UP vs RIGHT+DOWN.
  • Now, mouse scratch has 4 directions: LEFT vs RIGHT, and UP vs DOWN.
  • This is useful if you have two turntables, where turntable 1 controls x-axis mouse and turntable 2 controls y-axis mouse.

Now the Key Configuration menu looks like this:
image

beatoraja configuration:
image

Other Changes

1. Remove arrays BMKEYSA, MIDIKEYSA

  • These two arrays are exactly the same as KEYSA. They are just a constant list of indexes for the assignable keys (not dependent on input method).
  • there is no reason for it to be different for KB, BM, MIDI etc

I removed these arrays because I don't think there is a point in adding a MSKEYSA for mouse scratch, because all of these arrays are exactly the same.

2. resetKeyAssign(int KBindex, int BMindex, int Midiindex)

  • this method is only called once, from input.isDeletePressed().
  • no reason to split kbindex, bmindex, midiindex.
  • renamed to deleteKeyAssign.
  • this method is different from resetKeyAssign, because resetKeyAssign only resets key assign for index >= 0.
  • deleteKeyAssign applies to index>=0 and index -1, -2 (except for KB input). It is used to set the key to default when you press DELETE.

@exch-bms2 exch-bms2 merged commit 95b89e6 into exch-bms2:master Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants