Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if Shift key is pressed during mousedown event

Tags:

Is it possible to determine whether the Shift key is pressed during a mousedown d3.event? if possible could show me a way to do this, try looking in the API, but could not find something useful

like image 922
Cristian G Avatar asked Sep 20 '12 18:09

Cristian G


1 Answers

You should be able to use something like this:

d3.select(window).on("click", function() {     if (d3.event.shiftKey) {         alert("Mouse+Shift pressed");     } }); 

Demo: http://jsfiddle.net/SO_AMK/NTGKG/1/

like image 103
A.M.K Avatar answered Oct 16 '22 22:10

A.M.K