OpenLayers v4.0.1 API - Namespace: condition

# Namespace: condition

This documentation is for OpenLayers v4.0.1. The latest is v.

## ol.events.condition

### Methods

#### ol.events.condition.altKeyOnly(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 17

  Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when additionally the shift-key is pressed).

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if only the alt key is pressed.

#### ol.events.condition.altShiftKeysOnly(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 34

  Return `true` if only the alt-key and shift-key is pressed, `false` otherwise (e.g. when additionally the platform-modifier-key is pressed).

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if only the alt and shift keys are pressed.

#### ol.events.condition.always(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 51

  Return always true.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True.

#### ol.events.condition.click(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 61

  Return `true` if the event is a `click` event, `false` otherwise.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if the event is a map `click` event.

#### ol.events.condition.doubleClick(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 125

  Return `true` if the event is a map `dblclick` event, `false` otherwise.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if the event is a map `dblclick` event.

#### ol.events.condition.mouseOnly(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 207

  Return `true` if the event originates from a mouse device.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if the event originates from a mouse device.

#### ol.events.condition.never(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 90

  Return always false.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  False.

#### ol.events.condition.noModifierKeys(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 138

  Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is pressed.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True only if there no modifier keys are pressed.

#### ol.events.condition.platformModifierKeyOnly(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 156

  Return `true` if only the platform-modifier-key (the meta-key on Mac, ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally the shift-key is pressed).

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if only the platform modifier key is pressed.

#### ol.events.condition.pointerMove(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 101

  Return `true` if the browser event is a `pointermove` event, `false` otherwise.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if the browser event is a `pointermove` event.

#### ol.events.condition.primaryAction(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 223

  Return `true` if the event originates from a primary pointer in contact with the surface or if the left mouse button is pressed.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  See:
    - http://www.w3.org/TR/pointerevents/#button-states

  ##### Returns:

  True if the event originates from a primary pointer.

#### ol.events.condition.shiftKeyOnly(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 173

  Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when additionally the alt-key is pressed).

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if only the shift key is pressed.

#### ol.events.condition.singleClick(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 113

  Return `true` if the event is a map `singleclick` event, `false` otherwise.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True if the event is a map `singleclick` event.

#### ol.events.condition.targetNotEditable(mapBrowserEvent){boolean}

src/ol/events/condition.js, line 190

  Return `true` if the target element is not editable, i.e. not a `<input>`-, `<select>`- or `<textarea>`-element, `false` otherwise.

  Name | Type | Description
  --- | --- | ---
  `mapBrowserEvent` | ol.MapBrowserEvent | Map browser event.

  ##### Returns:

  True only if the target element is not editable.