Device

APIRendererDevice

Source

Device.platform

Type:
Boolean
Default value:
'Unix'

Possible values are:

Text {
    text: 'You are using: ' + Device.platform
    font.pixelSize: 30
}

Source

Device.desktop

Type:
Boolean
Default value:
true

Source

Device.tablet

Type:
Boolean
Default value:
false

Source

Device.phone

Type:
Boolean
Default value:
false

Source

Device.mobile

Type:
Boolean
Default value:
false

Tablet or a phone.

Text {
    text: Device.mobile ? 'Mobile' : 'Desktop'
    font.pixelSize: 30
}

Source

Device.pixelRatio

Type:
Boolean
Default value:
1
Text {
    text: Device.pixelRatio >= 2 ? 'Retina' : 'Non-retina'
    font.pixelSize: 30
}

Source

Device.log(message...)

Parameters:
  • message... — String

Source

Device.pointer

Type:
Device.PointerEvent
Read Only

Source

Device.onPointerPress(event)

Parameters:
  • event — Device.PointerEvent
Type:
Signal

Source

Device.onPointerRelease(event)

Parameters:
  • event — Device.PointerEvent
Type:
Signal

Source

Device.onPointerMove(event)

Parameters:
  • event — Device.PointerEvent
Type:
Signal

Source

Device.onPointerWheel(event)

Parameters:
  • event — Device.PointerEvent
Type:
Signal

Source

Device.keyboard

Type:
Device.KeyboardEvent
Read Only

Source

Device.onKeyPress(event)

Parameters:
  • event — Device.KeyboardEvent
Type:
Signal

Source

Device.onKeyHold(event)

Parameters:
  • event — Device.KeyboardEvent
Type:
Signal

Source

Device.onKeyRelease(event)

Parameters:
  • event — Device.KeyboardEvent
Type:
Signal

Source

Device.onKeyInput(event)

Parameters:
  • event — Device.KeyboardEvent
Type:
Signal

Source

Class Device.PointerEvent

Source

PointerEvent::Device.x

Type:
Float
Read Only

PointerEvent::Device.onXChange(oldValue)

Parameters:
  • oldValue — Float
Type:
Signal

Source

PointerEvent::Device.y

Type:
Float
Read Only

PointerEvent::Device.onYChange(oldValue)

Parameters:
  • oldValue — Float
Type:
Signal

Source

PointerEvent::Device.movementX

Type:
Float
Read Only

PointerEvent::Device.onMovementXChange(oldValue)

Parameters:
  • oldValue — Float
Type:
Signal

Source

PointerEvent::Device.movementY

Type:
Float
Read Only

PointerEvent::Device.onMovementYChange(oldValue)

Parameters:
  • oldValue — Float
Type:
Signal

Source

PointerEvent::Device.deltaX

Type:
Float
Read Only

PointerEvent::Device.onDeltaXChange(oldValue)

Parameters:
  • oldValue — Float
Type:
Signal

Source

PointerEvent::Device.deltaY

Type:
Float
Read Only

PointerEvent::Device.onDeltaYChange(oldValue)

Parameters:
  • oldValue — Float
Type:
Signal

Source

**Class Device.KeyboardEvent**()

Source

KeyboardEvent::Device.visible

Type:
Boolean
Read Only

KeyboardEvent::Device.onVisibleChange(oldValue)

Parameters:
  • oldValue — Boolean
Type:
Signal

Source

KeyboardEvent::Device.height

Type:
Float
Read Only

KeyboardEvent::Device.onHeightChange(oldValue)

Parameters:
  • oldValue — Float
Type:
Signal

Source

KeyboardEvent::Device.key

Type:
String
Read Only

KeyboardEvent::Device.onKeyChange(oldValue)

Parameters:
  • oldValue — String
Type:
Signal

Source

KeyboardEvent::Device.text

Type:
String
Read Only

KeyboardEvent::Device.onTextChange(oldValue)

Parameters:
  • oldValue — String
Type:
Signal

Source

KeyboardEvent::Device.show()

Source

KeyboardEvent::Device.hide()

Source