Skip to content

Commit

Permalink
Add XkbStateRec struct definition
Browse files Browse the repository at this point in the history
This adds type and field name information to the _XkbStateRec struct for
the XkbGetState request.

The fields have been taken from my local
/usr/include/X11/extensions/XKBstr.h file, since online documentation
turned out to be incorrect/outdated, leading to struct layout issues.
  • Loading branch information
chrisduerr authored and malwrar committed Oct 26, 2020
1 parent 1437bee commit 58a881d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/xlib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ pub enum _XrmHashBucketRec {}
#[repr(C)] pub struct _XkbSection;
#[repr(C)] pub struct _XkbServerMapRec;
#[repr(C)] pub struct _XkbShape;
#[repr(C)] pub struct _XkbStateRec;
#[repr(C)] pub struct _XkbSymInterpretRec;

// union placeholders
Expand Down Expand Up @@ -1687,6 +1686,25 @@ pub struct _XkbNamesRec {
pub num_rg: c_ushort,
}

#[derive(Debug, Clone, Copy, PartialEq)]
#[repr(C)]
pub struct _XkbStateRec {
pub group: c_uchar,
pub locked_group: c_uchar,
pub base_group: c_ushort,
pub latched_group: c_ushort,
pub mods: c_uchar,
pub base_mods: c_uchar,
pub latched_mods: c_uchar,
pub locked_mods: c_uchar,
pub compat_state: c_uchar,
pub grab_mods: c_uchar,
pub compat_grab_mods: c_uchar,
pub lookup_mods: c_uchar,
pub compat_lookup_mods: c_uchar,
pub ptr_buttons: c_ushort,
}


//
// Xkb event structs
Expand Down

0 comments on commit 58a881d

Please sign in to comment.