add some asserts to validate KeyCode values

Change-Id: I1b4b8d44f11086ed994a093fef0029982fac2c63
Reviewed-on: https://gerrit.libreoffice.org/12161
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>