Mouse event for move, press, position and update real time?


#1

I hit a run block I don’t see mouse functions that I can able to used for example dragging a panel. To know the position of the mouse and the press state. Need some help how it work if there information how it setup. Just guess that there not going be in there.

Any ideas?


#2

I use the mouse events all the time. They work exactly the same as in a browser. Maybe you could show code that doesn’t work?


#3

I am new to this and not sure how the best to setup them up.


#4

On something like this you need to study how to program javascript with html in the browser and in particular you should study jQuery. There are about 1e99 websites that have tutorials for this stuff. You can use http://jsfiddle.net/ to practice. Then you should study coffeescript. It’s a different way to write javascript. Almost all of Atom and the packages are written in coffeescript.

For your first package may I suggest you install html-tab (my pkg) and add whatever coffeescript and html you want to the view file and it will show up in a new tab when you type ctrl-alt-H. You can add code to the page and try mousing around. Usually you add html to a view file with space-pen (see atom docs) but that is optional. You can add html directly with jQuery instead.

If you have any particular questions feel free to ask here.


#5

That help a bit. But it hard to understand some parts as much I building the packages right way in a clean way. Got the mouse working in browser java script coded in simple way. As I understand little bit of the atom formats.


#6

The best way to learn to write packages is to look at other packages. You can do that in the settings page by picking a package on the left and then clicking on “open in atom” on the right.

If you meand building as in compiling before running, then you should know you don’t have to do that at all. Just hit ctrl-alt-R and your package will be loaded.

Also, do you know about the command to generate a sample package? Just do ctrl-shift-P and look for generate package. It’s a great way to start writing a new package.


#7

There not much find as seem get update and many changes.It some time it hard to tell from example packages from atom and the wiki need some update. And it need more better explain the doc or wiki.