mouse-change

WebJar for mouse-change

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

mouse-change
Последняя версия

Последняя версия

1.4.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

mouse-change
WebJar for mouse-change
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/mikolalysenko/mouse-change

Скачать mouse-change

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/mouse-change/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>mouse-change</artifactId>
    <version>1.4.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/mouse-change/
implementation 'org.webjars.npm:mouse-change:1.4.0'
// https://jarcasting.com/artifacts/org.webjars.npm/mouse-change/
implementation ("org.webjars.npm:mouse-change:1.4.0")
'org.webjars.npm:mouse-change:jar:1.4.0'
<dependency org="org.webjars.npm" name="mouse-change" rev="1.4.0">
  <artifact name="mouse-change" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='mouse-change', version='1.4.0')
)
libraryDependencies += "org.webjars.npm" % "mouse-change" % "1.4.0"
[org.webjars.npm/mouse-change "1.4.0"]

Зависимости

compile (1)

Идентификатор библиотеки Тип Версия
org.webjars.npm : mouse-event jar [1.0.0,2)

Модули Проекта

Данный проект не имеет модулей.

mouse-change

Listens for any mouse state changes.

Example

require('mouse-change')(function(buttons, x, y) {
  document.body.innerHTML =
    '<p>Buttons: 0b' + buttons.toString(2) +
    ', x:' + x +
    ', y:' + y + '</p>'
})

Try it out in your browser

Install

npm i mouse-change

API

var l = require('mouse-change')([element, onchange(buttons,x,y,mods)])

Listens for any mouse state changes on the given element.

  • element is an optional element
  • onchange(buttons,x,y,mods) is an optional callback which gets called every time that the mouse state changes inside element
    • buttons is the state of the mouse buttons
    • x is the x coordinate of the mouse
    • y is the y coordinate of the mouse
    • mods is an object storing the state of any key modifiers
      • mods.shift is the state of the shift key
      • mods.alt is the state of then alt key
      • mods.control is the state of the control key
      • mods.meta is the state of the meta key

Returns A new listener object which can be used to configure the listener.

l.enabled

Toggles whether or not

l.x

The x coordinate of the mouse

l.y

The y coordinate of the mouse

l.buttons

The button state of the mouse

l.mods

The current state of the keyboard modifiers

License

(c) 2015 Mikola Lysenko. MIT License

Версии библиотеки

Версия
1.4.0