On Tue, Jan 22, 2019 at 10:28:07AM +0100, Gerd Hoffmann wrote: > Now that most user interfaces are using QKeyCodes it is easier to have > common keyboard code useable by all user interfaces. > > This patch adds helper code to track the state of all keyboard keys, > using a bitmap indexed by QKeyCode. Modifier state is tracked too, > as separate bitmap. That makes checking modifier state easier. > Likewise we can easily apply special handling for capslock & numlock > (toggles on keypress) and ctrl + shift (we have two keys for that). > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > --- > include/ui/kbd-state.h | 96 +++++++++++++++++++++++++++++++++++++ > ui/kbd-state.c | 125 > +++++++++++++++++++++++++++++++++++++++++++++++++ > ui/Makefile.objs | 2 +- > 3 files changed, 222 insertions(+), 1 deletion(-) > create mode 100644 include/ui/kbd-state.h > create mode 100644 ui/kbd-state.c > > diff --git a/include/ui/kbd-state.h b/include/ui/kbd-state.h > new file mode 100644 > index 0000000000..277198f169 > --- /dev/null > +++ b/include/ui/kbd-state.h > @@ -0,0 +1,96 @@
Missing license boilerplate header, and same in the .c file. > +#ifndef QEMU_UI_KBD_STATE_H > +#define QEMU_UI_KBD_STATE_H 1 With license header added Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|