Keymap

A #GdkKeymap defines the translation from keyboard state (including a hardware key, a modifier mask, and active keyboard group) to a keyval. This translation has two phases. The first phase is to determine the effective keyboard group and level for the keyboard state; the second phase is to look up the keycode/group/level triplet in the keymap and see what keyval it corresponds to.

Constructors

this
this(void* ptr, Flag!"Take" take)

Members

Functions

addVirtualModifiers
void addVirtualModifiers(gdk.types.ModifierType state)

Maps the non-virtual modifiers (i.e Mod2, Mod3, ...) which are set in state to the virtual modifiers (i.e. Super, Hyper and Meta) and set the corresponding bits in state.

connectDirectionChanged
gulong connectDirectionChanged(T callback, Flag!"After" after)

Connect to DirectionChanged signal.

connectKeysChanged
gulong connectKeysChanged(T callback, Flag!"After" after)

Connect to KeysChanged signal.

connectStateChanged
gulong connectStateChanged(T callback, Flag!"After" after)

Connect to StateChanged signal.

getCapsLockState
bool getCapsLockState()

Returns whether the Caps Lock modifer is locked.

getDirection
pango.types.Direction getDirection()

Returns the direction of effective layout of the keymap.

getEntriesForKeycode
bool getEntriesForKeycode(uint hardwareKeycode, gdk.types.KeymapKey[] keys, uint[] keyvals)

Returns the keyvals bound to hardware_keycode. The Nth #GdkKeymapKey in keys is bound to the Nth keyval in keyvals. Free the returned arrays with glib.global.gfree. When a keycode is pressed by the user, the keyval from this list of entries is selected by considering the effective keyboard group and level. See gdk.keymap.Keymap.translateKeyboardState.

getEntriesForKeyval
bool getEntriesForKeyval(uint keyval, gdk.types.KeymapKey[] keys)

Obtains a list of keycode/group/level combinations that will generate keyval. Groups and levels are two kinds of keyboard mode; in general, the level determines whether the top or bottom symbol on a key is used, and the group determines whether the left or right symbol is used. On US keyboards, the shift key changes the keyboard level, and there are no groups. A group switch key might convert a keyboard between Hebrew to English modes, for example. #GdkEventKey contains a group field that indicates the active keyboard group. The level is computed from the modifier mask. The returned array should be freed with glib.global.gfree.

getModifierMask
gdk.types.ModifierType getModifierMask(gdk.types.ModifierIntent intent)

Returns the modifier mask the keymap’s windowing system backend uses for a particular purpose.

getModifierState
uint getModifierState()

Returns the current modifier state.

getNumLockState
bool getNumLockState()

Returns whether the Num Lock modifer is locked.

getScrollLockState
bool getScrollLockState()

Returns whether the Scroll Lock modifer is locked.

haveBidiLayouts
bool haveBidiLayouts()

Determines if keyboard layouts for both right-to-left and left-to-right languages are in use.

lookupKey
uint lookupKey(gdk.types.KeymapKey key)

Looks up the keyval mapped to a keycode/group/level triplet. If no keyval is bound to key, returns 0. For normal user input, you want to use gdk.keymap.Keymap.translateKeyboardState instead of this function, since the effective group/level may not be the same as the current keyboard state.

mapVirtualModifiers
bool mapVirtualModifiers(gdk.types.ModifierType state)

Maps the virtual modifiers (i.e. Super, Hyper and Meta) which are set in state to their non-virtual counterparts (i.e. Mod2, Mod3,...) and set the corresponding bits in state.

self
Keymap self()

Returns this, for use in with statements.

translateKeyboardState
bool translateKeyboardState(uint hardwareKeycode, gdk.types.ModifierType state, int group, uint keyval, int effectiveGroup, int level, gdk.types.ModifierType consumedModifiers)

Translates the contents of a #GdkEventKey into a keyval, effective group, and level. Modifiers that affected the translation and are thus unavailable for application use are returned in consumed_modifiers. See Groups[key-group-explanation] for an explanation of groups and levels. The effective_group is the group that was actually used for the translation; some keys such as Enter are not affected by the active keyboard group. The level is derived from state. For convenience, #GdkEventKey already contains the translated keyval, so this function isn’t as useful as you might think.

Properties

_gType
GType _gType [@property getter]

Static functions

_getGType
GType _getGType()
builder
KeymapGidBuilder builder()

Get builder for gdk.keymap.Keymap

getDefault
gdk.keymap.Keymap getDefault()

Returns the #GdkKeymap attached to the default display.

getForDisplay
gdk.keymap.Keymap getForDisplay(gdk.display.Display display)

Returns the #GdkKeymap attached to display.

Inherited Members

From ObjectWrap

_setGObject
void _setGObject(void* cObj, Flag!"Take" take)

Set the GObject of a D ObjectWrap wrapper.

_cPtr
void* _cPtr(Flag!"Dup" dup)

Get a pointer to the underlying C object.

_ref
void* _ref(void* gObj)

Calls g_object_ref() on a GObject.

_unref
_unref(void* gObj)

Calls g_object_unref() on a GObject.

_getGType
GType _getGType()

Get the GType of an object.

_gType
GType _gType [@property getter]

GObject GType property.

self
ObjectWrap self()

Convenience method to return this cast to a type. For use in D with statements.

_getDObject
T _getDObject(void* cptr, Flag!"Take" take)

Template to get the D object from a C GObject and cast it to the given D object type.

connectSignalClosure
gulong connectSignalClosure(string signalDetail, DClosure closure, Flag!"After" after)

Connect a D closure to an object signal.

setProperty
void setProperty(string propertyName, T val)

Template for setting a GObject property.

getProperty
T getProperty(string propertyName)

Template for getting a GObject property.

compatControl
size_t compatControl(size_t what, void* data)
bindProperty
gobject.binding.Binding bindProperty(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags)

Creates a binding between source_property on source and target_property on target.

bindPropertyFull
gobject.binding.Binding bindPropertyFull(string sourceProperty, gobject.object.ObjectWrap target, string targetProperty, gobject.types.BindingFlags flags, gobject.closure.Closure transformTo, gobject.closure.Closure transformFrom)

Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

forceFloating
void forceFloating()

This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectWrap.refSink.

freezeNotify
void freezeNotify()

Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

getData
void* getData(string key)

Gets a named field from the objects table of associations (see gobject.object.ObjectWrap.setData).

getProperty
void getProperty(string propertyName, gobject.value.Value value)

Gets a property of an object.

getQdata
void* getQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata.

getv
void getv(string[] names, gobject.value.Value[] values)

Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

isFloating
bool isFloating()

Checks whether object has a floating[floating-ref] reference.

notify
void notify(string propertyName)

Emits a "notify" signal for the property property_name on object.

notifyByPspec
void notifyByPspec(gobject.param_spec.ParamSpec pspec)

Emits a "notify" signal for the property specified by pspec on object.

refSink
gobject.object.ObjectWrap refSink()

Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.

runDispose
void runDispose()

Releases all references to other objects. This can be used to break reference cycles.

setData
void setData(string key, void* data)

Each object carries around a table of associations from strings to pointers. This function lets you set an association.

setProperty
void setProperty(string propertyName, gobject.value.Value value)

Sets a property on an object.

stealData
void* stealData(string key)

Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

stealQdata
void* stealQdata(glib.types.Quark quark)

This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

thawNotify
void thawNotify()

Reverts the effect of a previous call to gobject.object.ObjectWrap.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

watchClosure
void watchClosure(gobject.closure.Closure closure)

This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectWrap.ref_ and gobject.object.ObjectWrap.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

connectNotify
gulong connectNotify(string detail, T callback, Flag!"After" after)

Connect to Notify signal.