All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Input: input-event-codes - add keycodes for gaming peripherals
@ 2015-12-24 21:25 Tolga Cakir
  2016-06-18  8:33 ` Clément Vuchener
  0 siblings, 1 reply; 2+ messages in thread
From: Tolga Cakir @ 2015-12-24 21:25 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-input, Tolga Cakir

Gaming peripherals without onboard memory or with switchable software macro,
like Logitech G510 / G700 / G710 / G710+, Microsoft Sidewinder X4 / X6 or
Corsair K90, have many keys in common. This patch adds the most common physical
keys among gaming peripherals, so they can be used by existing and future kernel
modules.

Included are keycodes for profile management, macro recording and macro keys.
While some gaming peripherals have a seperate key for each profile (KEY_M[1-3]),
others have a single key, which loops through profiles (KEY_BANK_SWITCH).

Almost all gaming peripherals only support up to 3 profiles, so KEY_M[1-3]
should be sufficient. For macro keys, KEY_[G1-30] should cover all use cases.
Microsoft Sidewinder X6 has 30 unique macro keys and is followed by the Logitech
G13 with 25 macro keys.

Signed-off-by: Tolga Cakir <tolga@cevel.net>
---
 include/uapi/linux/input-event-codes.h | 37 ++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 87cf351..81e1f17 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -611,6 +611,43 @@
 #define KEY_KBDINPUTASSIST_ACCEPT		0x264
 #define KEY_KBDINPUTASSIST_CANCEL		0x265
 
+#define KEY_BANK_SWITCH		0x270	/* used by gaming peripherals */
+#define KEY_M1			0x271	/* Profile Management */
+#define KEY_M2			0x272
+#define KEY_M3			0x273
+#define KEY_MR			0x274	/* Macro Record */
+
+#define KEY_G1			0x275	/* Macro Keys */
+#define KEY_G2			0x276
+#define KEY_G3			0x277
+#define KEY_G4			0x278
+#define KEY_G5			0x279
+#define KEY_G6			0x27a
+#define KEY_G7			0x27b
+#define KEY_G8			0x27c
+#define KEY_G9			0x27d
+#define KEY_G10			0x27e
+#define KEY_G11			0x27f
+#define KEY_G12			0x280
+#define KEY_G13			0x281
+#define KEY_G14			0x282
+#define KEY_G15			0x283
+#define KEY_G16			0x284
+#define KEY_G17			0x285
+#define KEY_G18			0x286
+#define KEY_G19			0x287
+#define KEY_G20			0x288
+#define KEY_G21			0x289
+#define KEY_G22			0x28a
+#define KEY_G23			0x28b
+#define KEY_G24			0x28c
+#define KEY_G25			0x28d
+#define KEY_G26			0x28e
+#define KEY_G27			0x28f
+#define KEY_G28			0x290
+#define KEY_G29			0x291
+#define KEY_G30			0x292
+
 #define BTN_TRIGGER_HAPPY		0x2c0
 #define BTN_TRIGGER_HAPPY1		0x2c0
 #define BTN_TRIGGER_HAPPY2		0x2c1
-- 
2.6.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Input: input-event-codes - add keycodes for gaming peripherals
  2015-12-24 21:25 [PATCH] Input: input-event-codes - add keycodes for gaming peripherals Tolga Cakir
@ 2016-06-18  8:33 ` Clément Vuchener
  0 siblings, 0 replies; 2+ messages in thread
From: Clément Vuchener @ 2016-06-18  8:33 UTC (permalink / raw)
  To: Tolga Cakir; +Cc: dmitry.torokhov, linux-input

Any comment on this? I would be interested in this kind of key codes for
Corsair gaming keyboards.

On Thu, Dec 24, 2015 at 10:25:27PM +0100, Tolga Cakir wrote:
> Gaming peripherals without onboard memory or with switchable software macro,
> like Logitech G510 / G700 / G710 / G710+, Microsoft Sidewinder X4 / X6 or
> Corsair K90, have many keys in common. This patch adds the most common physical
> keys among gaming peripherals, so they can be used by existing and future kernel
> modules.
> 
> Included are keycodes for profile management, macro recording and macro keys.
> While some gaming peripherals have a seperate key for each profile (KEY_M[1-3]),
> others have a single key, which loops through profiles (KEY_BANK_SWITCH).
> 
> Almost all gaming peripherals only support up to 3 profiles, so KEY_M[1-3]
> should be sufficient. For macro keys, KEY_[G1-30] should cover all use cases.
> Microsoft Sidewinder X6 has 30 unique macro keys and is followed by the Logitech
> G13 with 25 macro keys.
> 
> Signed-off-by: Tolga Cakir <tolga@cevel.net>
> ---
>  include/uapi/linux/input-event-codes.h | 37 ++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> index 87cf351..81e1f17 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -611,6 +611,43 @@
>  #define KEY_KBDINPUTASSIST_ACCEPT		0x264
>  #define KEY_KBDINPUTASSIST_CANCEL		0x265
>  
> +#define KEY_BANK_SWITCH		0x270	/* used by gaming peripherals */
> +#define KEY_M1			0x271	/* Profile Management */
> +#define KEY_M2			0x272
> +#define KEY_M3			0x273
> +#define KEY_MR			0x274	/* Macro Record */

On Corsair keyboards, there is one physical MR key, but it sends
differents events when it starts or stops the recording. So is a single
KEY_MR key code better or should we have KEY_MR_TOGGLE and KEY_MR_START and KEY_MR_STOP
key codes?

> +
> +#define KEY_G1			0x275	/* Macro Keys */
> +#define KEY_G2			0x276
> +#define KEY_G3			0x277
> +#define KEY_G4			0x278
> +#define KEY_G5			0x279
> +#define KEY_G6			0x27a
> +#define KEY_G7			0x27b
> +#define KEY_G8			0x27c
> +#define KEY_G9			0x27d
> +#define KEY_G10			0x27e
> +#define KEY_G11			0x27f
> +#define KEY_G12			0x280
> +#define KEY_G13			0x281
> +#define KEY_G14			0x282
> +#define KEY_G15			0x283
> +#define KEY_G16			0x284
> +#define KEY_G17			0x285
> +#define KEY_G18			0x286
> +#define KEY_G19			0x287
> +#define KEY_G20			0x288
> +#define KEY_G21			0x289
> +#define KEY_G22			0x28a
> +#define KEY_G23			0x28b
> +#define KEY_G24			0x28c
> +#define KEY_G25			0x28d
> +#define KEY_G26			0x28e
> +#define KEY_G27			0x28f
> +#define KEY_G28			0x290
> +#define KEY_G29			0x291
> +#define KEY_G30			0x292
> +
>  #define BTN_TRIGGER_HAPPY		0x2c0
>  #define BTN_TRIGGER_HAPPY1		0x2c0
>  #define BTN_TRIGGER_HAPPY2		0x2c1
> -- 
> 2.6.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-input" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-18  8:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-24 21:25 [PATCH] Input: input-event-codes - add keycodes for gaming peripherals Tolga Cakir
2016-06-18  8:33 ` Clément Vuchener

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.