Gdk.Seat¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| get_capabilities() | |
| get_display() | |
| get_keyboard() | |
| get_pointer() | |
| get_slaves(capabilities) | |
| grab(window, capabilities, owner_events, cursor, event, prepare_func, *prepare_func_data) | |
| ungrab() | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| display | Gdk.Display | r/w/co | Display | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| device-added | The ::device-addedsignal is emitted when a new input device is related to this seat. | 
| device-removed | The ::device-removedsignal is emitted when an input device is removed (e.g. | 
| tool-added | The ::tool-addedsignal is emitted whenever a new tool is made known to the seat. | 
| tool-removed | This signal is emitted whenever a tool is no longer known to this seat. | 
Class Details¶
- 
class Gdk.Seat(**kwargs)¶
- Bases: - GObject.Object- Abstract: - Yes - The - Gdk.Seatobject represents a collection of input devices that belong to a user.- 
get_capabilities()[source]¶
- Returns: - the seat capabilities - Return type: - Gdk.SeatCapabilities- Returns the capabilities this - Gdk.Seatcurrently has.- New in version 3.20. 
 - 
get_display()[source]¶
- Returns: - a - Gdk.Display. This object is owned by GTK+ and must not be freed.- Return type: - Gdk.Display- Returns the - Gdk.Displaythis seat belongs to.
 - 
get_keyboard()[source]¶
- Returns: - a master - Gdk.Devicewith keyboard capabilities. This object is owned by GTK+ and must not be freed.- Return type: - Gdk.Deviceor- None- Returns the master device that routes keyboard events. - New in version 3.20. 
 - 
get_pointer()[source]¶
- Returns: - a master - Gdk.Devicewith pointer capabilities. This object is owned by GTK+ and must not be freed.- Return type: - Gdk.Deviceor- None- Returns the master device that routes pointer events. - New in version 3.20. 
 - 
get_slaves(capabilities)[source]¶
- Parameters: - capabilities ( - Gdk.SeatCapabilities) – capabilities to get devices for- Returns: - A list of - Gdk.Devices. The list must be freed with g_list_free(), the elements are owned by GDK and must not be freed.- Return type: - [ - Gdk.Device]- Returns the slave devices that match the given capabilities. - New in version 3.20. 
 - 
grab(window, capabilities, owner_events, cursor, event, prepare_func, *prepare_func_data)[source]¶
- Parameters: - window (Gdk.Window) – theGdk.Windowwhich will own the grab
- capabilities (Gdk.SeatCapabilities) – capabilities that will be grabbed
- owner_events (bool) – ifFalsethen all device events are reported with respect to window and are only reported if selected by event_mask. IfTruethen pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to window and only if selected by event_mask. In either mode, unreported events are discarded.
- cursor (Gdk.CursororNone) – the cursor to display while the grab is active. If this isNonethen the normal cursors are used for window and its descendants, and the cursor for window is used elsewhere.
- event (Gdk.EventorNone) – the event that is triggering the grab, orNoneif none is available.
- prepare_func (Gdk.SeatGrabPrepareFuncorNone) – function to prepare the window to be grabbed, it can beNoneif window is visible before this call.
- prepare_func_data (objectorNone) – user data to pass to prepare_func
 - Returns: - Gdk.GrabStatus.SUCCESSif the grab was successful.- Return type: - Grabs the seat so that all events corresponding to the given capabilities are passed to this application until the seat is ungrabbed with - Gdk.Seat.ungrab(), or the window becomes hidden. This overrides any previous grab on the seat by this client.- As a rule of thumb, if a grab is desired over - Gdk.SeatCapabilities.POINTER, all other “pointing” capabilities (eg.- Gdk.SeatCapabilities.TOUCH) should be grabbed too, so the user is able to interact with all of those while the grab holds, you should thus use- Gdk.SeatCapabilities.ALL_POINTINGmost commonly.- Grabs are used for operations which need complete control over the events corresponding to the given capabilities. For example in GTK+ this is used for Drag and Drop operations, popup menus and such. - Note that if the event mask of a - Gdk.Windowhas selected both button press and button release events, or touch begin and touch end, then a press event will cause an automatic grab until the button is released, equivalent to a grab on the window with owner_events set to- True. This is done because most applications expect to receive paired press and release events.- If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the - Gdk.EventGrabBrokenevents that are emitted when the grab ends unvoluntarily.- New in version 3.20. 
- window (
 - 
ungrab()[source]¶
- Releases a grab added through - Gdk.Seat.grab().- New in version 3.20. 
 
- 
Signal Details¶
- 
Gdk.Seat.signals.device_added(seat, device)¶
- Signal Name: - device-added- Flags: - Parameters: - seat (Gdk.Seat) – The object which received the signal
- device (Gdk.Device) – the newly addedGdk.Device.
 - The - ::device-addedsignal is emitted when a new input device is related to this seat.- New in version 3.20. 
- seat (
- 
Gdk.Seat.signals.device_removed(seat, device)¶
- Signal Name: - device-removed- Flags: - Parameters: - seat (Gdk.Seat) – The object which received the signal
- device (Gdk.Device) – the just removedGdk.Device.
 - The - ::device-removedsignal is emitted when an input device is removed (e.g. unplugged).- New in version 3.20. 
- seat (
- 
Gdk.Seat.signals.tool_added(seat, tool)¶
- Signal Name: - tool-added- Flags: - Parameters: - seat (Gdk.Seat) – The object which received the signal
- tool (Gdk.DeviceTool) – the newGdk.DeviceToolknown to the seat
 - The - ::tool-addedsignal is emitted whenever a new tool is made known to the seat. The tool may later be assigned to a device (i.e. on proximity with a tablet). The device will emit the- Gdk.Device- ::tool-changedsignal accordingly.- A same tool may be used by several devices. - New in version 3.22. 
- seat (
- 
Gdk.Seat.signals.tool_removed(seat, tool)¶
- Signal Name: - tool-removed- Flags: - Parameters: - seat (Gdk.Seat) – The object which received the signal
- tool (Gdk.DeviceTool) – the just removedGdk.DeviceTool
 - This signal is emitted whenever a tool is no longer known to this seat. - New in version 3.22. 
- seat (
Property Details¶
- 
Gdk.Seat.props.display¶
- Name: - display- Type: - Gdk.Display- Default Value: - None- Flags: - READABLE,- WRITABLE,- CONSTRUCT_ONLY- Gdk.Displayof this seat.- New in version 3.20.