### Method

# Gdk Surface get_device_position

#### Declaration [src]

    gboolean
    gdk_surface_get_device_position (
      GdkSurface* surface,
      GdkDevice* device,
      double* x,
      double* y,
      GdkModifierType* mask
    )

#### Description [src]

Obtains the current device position and modifier state.

The position is given in coordinates relative to the upper left corner of `surface`.

#### Parameters

`device` | `GdkDevice`
| Pointer `GdkDevice` to query to.
| The data is owned by the caller of the function.
`x` | `double*`
| Return location for the X coordinate of `device`.
| The argument will be set by the function.
| The argument can be `NULL`.
| The instance takes ownership of the data, and is responsible for freeing it.
`y` | `double*`
| Return location for the Y coordinate of `device`.
| The argument will be set by the function.
| The argument can be `NULL`.
| The instance takes ownership of the data, and is responsible for freeing it.
`mask` | `GdkModifierType`
| Return location for the modifier mask.
| The argument will be set by the function.
| The argument can be `NULL`.
| The instance takes ownership of the data, and is responsible for freeing it.

#### Return value

Returns: | `gboolean`
| `TRUE` if the device is over the surface.