Skip to contentSkip to conversation

Input: document meanings of KEY_SCREEN and KEY_ZOOM

PATCH In review Dmitry Torokhov 4 participants 13 messages Jan 18, 2019 – Mar 21, 2019

Subsystems (4)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/7 Input: document meanings of KEY_SCREEN and KEY_ZOOM

It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB folks have used them to indicate switch to full screen mode. Later, they converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).

Let's commit to these uses, and define:

- KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
- KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)

---

Please let me know how we want merge this. Some of patches can be applied independently and I tried marking them as such, but some require new key names from input.h

 include/uapi/linux/input-event-codes.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/uapi/linux/input-event-codes.h +4 -2
index ae366b87426a..bc5054e51bef 100644
@@ -439,10 +439,12 @@
 #define KEY_TITLE		0x171
 #define KEY_SUBTITLE		0x172
 #define KEY_ANGLE		0x173
-#define KEY_ZOOM		0x174
+#define KEY_FULL_SCREEN		0x174	/* AC View Toggle */
+#define KEY_ZOOM		KEY_FULL_SCREEN
 #define KEY_MODE		0x175
 #define KEY_KEYBOARD		0x176
-#define KEY_SCREEN		0x177
+#define KEY_ASPECT_RATIO	0x177	/* HUTRR37: Aspect */
+#define KEY_SCREEN		KEY_ASPECT_RATIO
 #define KEY_PC			0x178	/* Media Select Computer */
 #define KEY_TV			0x179	/* Media Select TV */
 #define KEY_TV2			0x17a	/* Media Select Cable */
Signature · 1 line
2.20.1.321.g9e740568ce-goog
author maintainer
#1 lore raw

PATCH 2/7 doc-rst: switch to new names for Full Screen/Aspect keys

We defined better names for keys to activate full screen mode or change aspect ratio (while keeping the existing keycodes to avoid breaking userspace), so let's use them in the document.

---
 Documentation/media/uapi/rc/rc-tables.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/media/uapi/rc/rc-tables.rst +2 -2
index c8ae9479f842..57797e56f45e 100644
@@ -616,7 +616,7 @@ the remote via /dev/input/event devices.
 
     -  .. row 78
 
-       -  ``KEY_SCREEN``
+       -  ``KEY_ASPECT_RATIO``
 
        -  Select screen aspect ratio
 
@@ -624,7 +624,7 @@ the remote via /dev/input/event devices.
 
     -  .. row 79
 
-       -  ``KEY_ZOOM``
+       -  ``KEY_FULL_SCREEN``
 
        -  Put device into zoom/full screen mode
 
Signature · 1 line
2.20.1.321.g9e740568ce-goog
author maintainer
#2 lore raw

Re: [PATCH 2/7] [media] doc-rst: switch to new names for Full Screen/Aspect keys

Quoted 7 lines · Dmitry Torokhov

We defined better names for keys to activate full screen mode or change aspect ratio (while keeping the existing keycodes to avoid breaking userspace), so let's use them in the document.

---
 Documentation/media/uapi/rc/rc-tables.rst | 4 ++--

Mauro, do you want to take this through your tree or I should pick it up with the patch that does renames in uapi header?

Thanks!

Quoted 27 lines
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/media/uapi/rc/rc-tables.rst +2 -2
index c8ae9479f842..57797e56f45e 100644
@@ -616,7 +616,7 @@ the remote via /dev/input/event devices.
 
     -  .. row 78
 
-       -  ``KEY_SCREEN``
+       -  ``KEY_ASPECT_RATIO``
 
        -  Select screen aspect ratio
 
@@ -624,7 +624,7 @@ the remote via /dev/input/event devices.
 
     -  .. row 79
 
-       -  ``KEY_ZOOM``
+       -  ``KEY_FULL_SCREEN``
 
        -  Put device into zoom/full screen mode
 
Signature · 1 line
2.20.1.321.g9e740568ce-goog
Signature · 1 line
Dmitry
maintainer Acked-by
#3 lore raw

Re: [PATCH 2/7] [media] doc-rst: switch to new names for Full Screen/Aspect keys

Em Sun, 17 Feb 2019 23:26:06 -0800
Dmitry Torokhov <[email protected]> escreveu:

Quoted 11 lines · Dmitry Torokhov
Quoted 7 lines

We defined better names for keys to activate full screen mode or change aspect ratio (while keeping the existing keycodes to avoid breaking userspace), so let's use them in the document.

---
 Documentation/media/uapi/rc/rc-tables.rst | 4 ++--  

Mauro, do you want to take this through your tree or I should pick it up with the patch that does renames in uapi header?

Feel free to apply it via your tree. It probably makes sense to keep it with the series that add the new codes.

Quoted 22 lines

Thanks!

Quoted 19 lines
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/media/uapi/rc/rc-tables.rst +1 -1
index c8ae9479f842..57797e56f45e 100644
@@ -616,7 +616,7 @@ the remote via /dev/input/event devices.
 
     -  .. row 78
 
-       -  ``KEY_SCREEN``
+       -  ``KEY_ASPECT_RATIO``
 
        -  Select screen aspect ratio
 
@@ -624,7 +624,7 @@ the remote via /dev/input/event devices.
 
     -  .. row 79
 
Quoted 9 lines
Quoted 8 lines
Documentation/media/uapi/rc/rc-tables.rst +1 -1
-       -  ``KEY_ZOOM``
+       -  ``KEY_FULL_SCREEN``
 
        -  Put device into zoom/full screen mode
 
Signature · 1 line
2.20.1.321.g9e740568ce-goog

Thanks,
Mauro

author maintainer
#4 lore raw

PATCH 3/7 HID: input: fix mapping of aspect ratio key

In reply to Dmitry Torokhov

According to HUTRR37 usage 0x6d from the consumer usage page corresponds to action that selects the next available supported aspect ratio option on a device which outputs or displays video. However KEY_ZOOM means activate "Full Screen" mode, KEY_ASPECT_RATIO should be used instead.

---
 drivers/hid/hid-input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-input.c +1 -1
index d6fab5798487..def58c6aa835 100644
@@ -891,7 +891,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		case 0x06a: map_key_clear(KEY_GREEN);		break;
 		case 0x06b: map_key_clear(KEY_BLUE);		break;
 		case 0x06c: map_key_clear(KEY_YELLOW);		break;
-		case 0x06d: map_key_clear(KEY_ZOOM);		break;
+		case 0x06d: map_key_clear(KEY_ASPECT_RATIO);	break;
 
 		case 0x06f: map_key_clear(KEY_BRIGHTNESSUP);		break;
 		case 0x070: map_key_clear(KEY_BRIGHTNESSDOWN);		break;
Signature · 1 line
2.20.1.321.g9e740568ce-goog
author maintainer
#5 lore raw

PATCH 4/7 HID: input: add mapping for Expose/Overview key

In reply to Dmitry Torokhov

According to HUTRR77 usage 0x29f from the consumer page is reserved for the Desktop application to present all running user’s application windows. Linux defines KEY_SCALE to request Compiz Scale (Expose) mode, so let's add the mapping.

---

This can be applied independently.

 drivers/hid/hid-input.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-input.c +2 -0
index def58c6aa835..5f800e7b04f2 100644
@@ -1030,6 +1030,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		case 0x2cb: map_key_clear(KEY_KBDINPUTASSIST_ACCEPT);	break;
 		case 0x2cc: map_key_clear(KEY_KBDINPUTASSIST_CANCEL);	break;
 
+		case 0x29f: map_key_clear(KEY_SCALE);		break;
+
 		default: map_key_clear(KEY_UNKNOWN);
 		}
 		break;
Signature · 1 line
2.20.1.321.g9e740568ce-goog
author maintainer
#6 lore raw

PATCH 5/7 HID: input: add mapping for keyboard Brightness Up/Down/Toggle keys

In reply to Dmitry Torokhov

According to HUTRR73 usages 0x79, 0x7a and 0x7c from the consumer page correspond to Brightness Up/Down/Toggle keys, so let's add the mappings.

---

This can be applied independently.

 drivers/hid/hid-input.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hid/hid-input.c +4 -0
index 5f800e7b04f2..cebe8a8cce2e 100644
@@ -900,6 +900,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		case 0x074: map_key_clear(KEY_BRIGHTNESS_MAX);		break;
 		case 0x075: map_key_clear(KEY_BRIGHTNESS_AUTO);		break;
 
+		case 0x079: map_key_clear(KEY_KBDILLUMUP);	break;
+		case 0x07a: map_key_clear(KEY_KBDILLUMDOWN);	break;
+		case 0x07c: map_key_clear(KEY_KBDILLUMTOGGLE);	break;
+
 		case 0x082: map_key_clear(KEY_VIDEO_NEXT);	break;
 		case 0x083: map_key_clear(KEY_LAST);		break;
 		case 0x084: map_key_clear(KEY_ENTER);		break;
Signature · 1 line
2.20.1.321.g9e740568ce-goog
author maintainer
#7 lore raw

PATCH 6/7 HID: input: add mapping for "Full Screen" key

In reply to Dmitry Torokhov

According to HUT 1.12 usage 0x232 from the consumer page is reserved for switching application between full screen and windowed mode, so let's add the mapping.

---

This needs the new key definition.

 drivers/hid/hid-input.c | 1 +
 1 file changed, 1 insertion(+)
drivers/hid/hid-input.c +1 -0
index cebe8a8cce2e..ecb1b6f26853 100644
@@ -1014,6 +1014,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 		case 0x22d: map_key_clear(KEY_ZOOMIN);		break;
 		case 0x22e: map_key_clear(KEY_ZOOMOUT);		break;
 		case 0x22f: map_key_clear(KEY_ZOOMRESET);	break;
+		case 0x232: map_key_clear(KEY_FULL_SCREEN);	break;
 		case 0x233: map_key_clear(KEY_SCROLLUP);	break;
 		case 0x234: map_key_clear(KEY_SCROLLDOWN);	break;
 		case 0x238: map_rel(REL_HWHEEL);		break;
Signature · 1 line
2.20.1.321.g9e740568ce-goog
author maintainer
#8 lore raw

PATCH 7/7 HID: input: add mapping for "Toggle Display" key

In reply to Dmitry Torokhov

According to HUT 1.12 usage 0xb5 from the generic desktop page is reserved for switching between external and internal display, so let's add the mapping.

---

This can be applied independently.

 drivers/hid/hid-input.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/hid/hid-input.c +8 -0
index ecb1b6f26853..da76358cde06 100644
@@ -677,6 +677,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
 			break;
 		}
 
+		if ((usage->hid & 0xf0) == 0xb0) {	/* SC - Display */
+			switch (usage->hid & 0xf) {
+			case 0x05: map_key_clear(KEY_SWITCHVIDEOMODE); break;
+			default: goto ignore;
+			}
+			break;
+		}
+
 		/*
 		 * Some lazy vendors declare 255 usages for System Control,
 		 * leading to the creation of ABS_X|Y axis and too many others.
Signature · 1 line
2.20.1.321.g9e740568ce-goog
maintainer Acked-by on v1 1/7
#9 lore raw
In reply to Dmitry Torokhov
Quoted 10 lines · Dmitry Torokhov

It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB folks have used them to indicate switch to full screen mode. Later, they converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).

Let's commit to these uses, and define:

- KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
- KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)

Quoted 6 lines

---

Please let me know how we want merge this. Some of patches can be applied independently and I tried marking them as such, but some require new key names from input.h

for the HID changes, and feel free to take it through your tree as a whole, I don't expect any major conflicts rising up from this.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#10 lore raw
Quoted 13 lines · Jiri Kosina
Quoted 10 lines · Dmitry Torokhov

It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB folks have used them to indicate switch to full screen mode. Later, they converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).

Let's commit to these uses, and define:

- KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
- KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)

Quoted 8 lines
Quoted 6 lines

---

Please let me know how we want merge this. Some of patches can be applied independently and I tried marking them as such, but some require new key names from input.h

Quoted 3 lines

for the HID changes, and feel free to take it through your tree as a whole, I don't expect any major conflicts rising up from this.

Works for me too. My tests showed no issues, so that's OK from me.

Cheers,
Benjamin

Quoted 7 lines

Thanks,

--
Jiri Kosina
SUSE Labs

author maintainer
#11 lore raw
Quoted 17 lines · Benjamin Tissoires
Quoted 16 lines · Jiri Kosina
Quoted 13 lines · Dmitry Torokhov

It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB folks have used them to indicate switch to full screen mode. Later, they converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).

Let's commit to these uses, and define:

- KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
- KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)

---

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Please let me know how we want merge this. Some of patches can be applied independently and I tried marking them as such, but some require new key names from input.h

Mauro, any objections on pushing the media doc patch through my tree?

Thanks.

Signature · 1 line
Dmitry
maintainer Acked-by on v1 1/7
#12 lore raw
In reply to Dmitry Torokhov

Em Fri, 18 Jan 2019 15:30:31 -0800
Dmitry Torokhov <[email protected]> escreveu:

Quoted 11 lines

It is hard to say what KEY_SCREEN and KEY_ZOOM mean, but historically DVB folks have used them to indicate switch to full screen mode. Later, they converged on using KEY_ZOOM to switch into full screen mode and KEY)SCREEN to control aspect ratio (see Documentation/media/uapi/rc/rc-tables.rst).

Let's commit to these uses, and define:

- KEY_FULL_SCREEN (and make KEY_ZOOM its alias)
- KEY_ASPECT_RATIO (and make KEY_SCREEN its alias)

Feel free to apply via your tree.

Quoted 18 lines

---

Please let me know how we want merge this. Some of patches can be applied independently and I tried marking them as such, but some require new key names from input.h

 include/uapi/linux/input-event-codes.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
include/uapi/linux/input-event-codes.h +0 -1
index ae366b87426a..bc5054e51bef 100644
@@ -439,10 +439,12 @@
 #define KEY_TITLE		0x171
 #define KEY_SUBTITLE		0x172
 #define KEY_ANGLE		0x173
-#define KEY_ZOOM		0x174

include/uapi/linux/input-event-codes.h line 450

Quoted 10 lines
include/uapi/linux/input-event-codes.h +4 -1
+#define KEY_FULL_SCREEN		0x174	/* AC View Toggle */
+#define KEY_ZOOM		KEY_FULL_SCREEN
 #define KEY_MODE		0x175
 #define KEY_KEYBOARD		0x176
-#define KEY_SCREEN		0x177
+#define KEY_ASPECT_RATIO	0x177	/* HUTRR37: Aspect */
+#define KEY_SCREEN		KEY_ASPECT_RATIO
 #define KEY_PC			0x178	/* Media Select Computer */
 #define KEY_TV			0x179	/* Media Select TV */
 #define KEY_TV2			0x17a	/* Media Select Cable */

Thanks,
Mauro