KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I would like to respond to keystroke events directed at nodes in my force layout. I've tried adding all the variants of "keystroke", "keypress", "keyup", "keydown" that I could think of, but none of them is firing. My mouse events fire just fine. I couldn't find any keystroke events in the d3 source.... is there a way to capture key strokes? nodes.enter().append("circle") .on("click", function(d) { return d.clickHandler(self); }) .on("mouseover", function(d) { return d.mouseOverHandler(self); }) .on("mouseout", function(d) { return d.mouseOutHandler(self); }) .on("keyup", function(d) { console.log("keypress", d3.event); // also tried "keyup", "keydown", "key" }) .classed("qNode", true) .call(force.drag);
Tags (comma-separated)
Save Edits
Cancel