selecto
selecto copied to clipboard
Start selecting only on key press.
Environments
- Framework name:react
- Framework version:latest
- Component name: react-selecto
- Component version: 1.12.0
- Testable Address(optional):
Description
Is there a way to start selection only on keypress? For example, I want to start selecting only when I have the ctrl key pressed, not all the time.
@Mako-L
Let's take the keycon module as an example.
If the ctrl key is not pressed, call the stop function in the onDragStart event.
import KeyController from "keycon";
const keycon = new KeyController();
<Selecto
onDragStart={e => {
if (!keycon.ctrlKey) {
e.stop();
return;
}
}};