Skip to content

How to move a puzzle piece in the middle? #45

Answered by flbulgarelli
RukshanJS asked this question in Q&A
Discussion options

You must be logged in to vote

I have just released a new version of headbreaker that ships with that functionality. You can check it here: https://flbulgarelli.github.io/headbreaker/#keyboard-gestures.

You can find more details here:

headbreaker/src/canvas.js

Lines 336 to 357 in d015591

/**
* Registers keyboard gestures. `gestures` must be an object with one or more entries with the following format:
*
* ```
* { keyStrokeNumber: (puzzle) => ...change drag mode... }
* ```
*
* For example, if you want to configure your canvas to force pieces to be moved together using the `alt` key, you can do the following:
*
* ```
* canvas.registerKeyboardGestures…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JeffroDB
Comment options

Answer selected by flbulgarelli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants