X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Finput%2Finput.c;h=011667fedda4269a26dedfa8b1f83a9486086519;hb=d37f020e6fe4af64dea7108652319e05e0d3279c;hp=e02e2643c9f2a385d22e7cc2435d07f624840638;hpb=cd810918fd638df4e91f232ec889896c6155440a;p=oweals%2Fu-boot.git diff --git a/drivers/input/input.c b/drivers/input/input.c index e02e2643c9..011667fedd 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -8,6 +8,7 @@ */ #include +#include #include #include #include @@ -19,9 +20,9 @@ enum { /* These correspond to the lights on the keyboard */ - FLAG_NUM_LOCK = 1 << 0, - FLAG_CAPS_LOCK = 1 << 1, - FLAG_SCROLL_LOCK = 1 << 2, + FLAG_SCROLL_LOCK = 1 << 0, + FLAG_NUM_LOCK = 1 << 1, + FLAG_CAPS_LOCK = 1 << 2, /* Special flag ORed with key code to indicate release */ KEY_RELEASE = 1 << 15, @@ -479,6 +480,12 @@ static int input_keycodes_to_ascii(struct input_config *config, if ((config->flags & FLAG_CAPS_LOCK) && ch >= 'a' && ch <= 'z') ch -= 'a' - 'A'; + /* ban digit numbers if 'Num Lock' is not on */ + if (!(config->flags & FLAG_NUM_LOCK)) { + if (key >= KEY_KP7 && key <= KEY_KPDOT && + key != KEY_KPMINUS && key != KEY_KPPLUS) + ch = 0xff; + } if (ch_count < max_chars && ch != 0xff) output_ch[ch_count++] = (uchar)ch; } else {