naver / egjs-axes

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates.
https://naver.github.io/egjs-axes/
MIT License
179 stars 32 forks source link

feat: add inputButton option to PanInputOption #182

Closed malangfox closed 2 years ago

malangfox commented 2 years ago

Details

Added inputButton to PanInputOption which used for PanInput and RotatePanInput. inputButton option contains the types of mouse buttons PanInput and RotatePanInput will recognize. inputButton option is ["left"] by default, you can configure like adding/changing it to "middle" and "right" . Since every touch is recognized as a left click as the PointerEvent, every touch is recognized as a left click. Added example of newly added option to the existing cube demo.

Example

movingcube

    axes
      .connect("rotateX rotateY", new PanInput(area, { inputButton: ["left"] ))
      .connect("offsetX offsetY", new PanInput(area, { inputButton: ["right"] }));

Things to be discussed