How to capture CTRL+Click


I asked in the IRC the other day and a folk suggested me atom-space-pen-views. I am not sure what it is :smile: , Any human friendly idea how to get notified each time the user holds ctrl and clicks something in the editor? Thanks!


Atom fully supports the normal DOM access. To subscribe to a click just do what you do in a web browser. With jquery it looks like

$('#someID').click -> console.log 'clicked'

To use jQuery you need to put {$} = require "atom-space-pen-views" at the top of your file. Then use the chrome inspector to find the IDs and Classes.

Edit: And to detect the ctrl key you use the normal event object …

$('#someID').click (e) -> console.log 'clicked with ctrl?', e.ctrlKey


Thank You! You are awesome!


Hi Steel :wink: if you remember we spoke a bit on IRC i was looking for you few hours after we spoke. Here is another example


Trudko: Thanks for the Example! Today must be my lucky day! :thumbsup: