Skip to content
Snippets Groups Projects
Commit a683d0d3 authored by Simon Glass's avatar Simon Glass
Browse files

input: Adjust structure of code in process_modifier()


Move all the '!release' code into one block so that it is clear that it only
applies on key release.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent b1d7a187
No related branches found
No related tags found
No related merge requests found
...@@ -236,7 +236,6 @@ static struct input_key_xlate *process_modifier(struct input_config *config, ...@@ -236,7 +236,6 @@ static struct input_key_xlate *process_modifier(struct input_config *config,
int key, int release) int key, int release)
{ {
struct input_key_xlate *table; struct input_key_xlate *table;
int flip = -1;
int i; int i;
/* Start with the main table, and see what modifiers change it */ /* Start with the main table, and see what modifiers change it */
...@@ -251,6 +250,8 @@ static struct input_key_xlate *process_modifier(struct input_config *config, ...@@ -251,6 +250,8 @@ static struct input_key_xlate *process_modifier(struct input_config *config,
/* Handle the lighted keys */ /* Handle the lighted keys */
if (!release) { if (!release) {
int flip = -1;
switch (key) { switch (key) {
case KEY_SCROLLLOCK: case KEY_SCROLLLOCK:
flip = FLAG_SCROLL_LOCK; flip = FLAG_SCROLL_LOCK;
...@@ -262,19 +263,19 @@ static struct input_key_xlate *process_modifier(struct input_config *config, ...@@ -262,19 +263,19 @@ static struct input_key_xlate *process_modifier(struct input_config *config,
flip = FLAG_CAPS_LOCK; flip = FLAG_CAPS_LOCK;
break; break;
} }
}
if (flip != -1) { if (flip != -1) {
int leds = 0; int leds = 0;
config->leds ^= flip; config->leds ^= flip;
if (config->flags & FLAG_NUM_LOCK) if (config->flags & FLAG_NUM_LOCK)
leds |= INPUT_LED_NUM; leds |= INPUT_LED_NUM;
if (config->flags & FLAG_CAPS_LOCK) if (config->flags & FLAG_CAPS_LOCK)
leds |= INPUT_LED_CAPS; leds |= INPUT_LED_CAPS;
if (config->flags & FLAG_SCROLL_LOCK) if (config->flags & FLAG_SCROLL_LOCK)
leds |= INPUT_LED_SCROLL; leds |= INPUT_LED_SCROLL;
config->leds = leds; config->leds = leds;
}
} }
return table; return table;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment