diff mbox series

[2/2] input: atakbd.c - fix Atari CapsLock behaviour

Message ID 1536277243-3821-3-git-send-email-schmitzmic@gmail.com (mailing list archive)
State Accepted
Headers show
Series input: atakbd.c bug fixes | expand

Commit Message

Michael Schmitz Sept. 6, 2018, 11:40 p.m. UTC
The CapsLock key on Atari keyboards is not a toggle, it does send the
normal make and break scancodes.

Drop the CapsLock toggle handling code, which did cause the CapsLock
key to merely act as a Shift key.

Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>

---
 drivers/input/keyboard/atakbd.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

Comments

Dmitry Torokhov Sept. 17, 2018, 7:43 p.m. UTC | #1
On Fri, Sep 07, 2018 at 11:40:43AM +1200, Michael Schmitz wrote:
> The CapsLock key on Atari keyboards is not a toggle, it does send the
> normal make and break scancodes.
> 
> Drop the CapsLock toggle handling code, which did cause the CapsLock
> key to merely act as a Shift key.
> 
> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>

Andreas, I have no idea how Atari keyboards work, can you add your
signed-off-by (or NAK) to this one as well please?

> 
> ---
>  drivers/input/keyboard/atakbd.c |   10 ++--------
>  1 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c
> index e989574..6caee80 100644
> --- a/drivers/input/keyboard/atakbd.c
> +++ b/drivers/input/keyboard/atakbd.c
> @@ -185,14 +185,8 @@ static void atakbd_interrupt(unsigned char scancode, char down)
>  
>  		scancode = atakbd_keycode[scancode];
>  
> -		if (scancode == KEY_CAPSLOCK) {	/* CapsLock is a toggle switch key on Amiga */
> -			input_report_key(atakbd_dev, scancode, 1);
> -			input_report_key(atakbd_dev, scancode, 0);
> -			input_sync(atakbd_dev);
> -		} else {
> -			input_report_key(atakbd_dev, scancode, down);
> -			input_sync(atakbd_dev);
> -		}
> +		input_report_key(atakbd_dev, scancode, down);
> +		input_sync(atakbd_dev);
>  	} else				/* scancodes >= 0xf3 are mouse data, most likely */
>  		printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode);
>  
> -- 
> 1.7.0.4
>
Andreas Schwab Sept. 17, 2018, 8:29 p.m. UTC | #2
On Sep 17 2018, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:

> On Fri, Sep 07, 2018 at 11:40:43AM +1200, Michael Schmitz wrote:
>> The CapsLock key on Atari keyboards is not a toggle, it does send the
>> normal make and break scancodes.
>> 
>> Drop the CapsLock toggle handling code, which did cause the CapsLock
>> key to merely act as a Shift key.
>> 
>> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
>> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
>
> Andreas, I have no idea how Atari keyboards work, can you add your
> signed-off-by (or NAK) to this one as well please?

The old atakbd driver never had that special handling.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>

Andreas.
Dmitry Torokhov Sept. 17, 2018, 10:36 p.m. UTC | #3
On Mon, Sep 17, 2018 at 10:29:08PM +0200, Andreas Schwab wrote:
> On Sep 17 2018, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> 
> > On Fri, Sep 07, 2018 at 11:40:43AM +1200, Michael Schmitz wrote:
> >> The CapsLock key on Atari keyboards is not a toggle, it does send the
> >> normal make and break scancodes.
> >> 
> >> Drop the CapsLock toggle handling code, which did cause the CapsLock
> >> key to merely act as a Shift key.
> >> 
> >> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
> >> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
> >
> > Andreas, I have no idea how Atari keyboards work, can you add your
> > signed-off-by (or NAK) to this one as well please?
> 
> The old atakbd driver never had that special handling.
> 
> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>

Applied, thank you.
Michael Schmitz Sept. 18, 2018, 2:03 a.m. UTC | #4
Thanks Dmitry!

I had asked Andreas' signoff for his keymap fixes only - the rewrite of 
the Atari keyboard driver to the current input framework (and hence the 
CapsLock toggle bug) was entirely mine, no blame attaches to Andreas there.

Cheers,

     Michael



On 18/09/18 10:36, Dmitry Torokhov wrote:
> On Mon, Sep 17, 2018 at 10:29:08PM +0200, Andreas Schwab wrote:
>> On Sep 17 2018, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
>>
>>> On Fri, Sep 07, 2018 at 11:40:43AM +1200, Michael Schmitz wrote:
>>>> The CapsLock key on Atari keyboards is not a toggle, it does send the
>>>> normal make and break scancodes.
>>>>
>>>> Drop the CapsLock toggle handling code, which did cause the CapsLock
>>>> key to merely act as a Shift key.
>>>>
>>>> Tested-by: Michael Schmitz <schmitzmic@gmail.com>
>>>> Signed-off-by: Michael Schmitz <schmitzmic@gmail.com>
>>> Andreas, I have no idea how Atari keyboards work, can you add your
>>> signed-off-by (or NAK) to this one as well please?
>> The old atakbd driver never had that special handling.
>>
>> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
> Applied, thank you.
>
Dmitry Torokhov Sept. 18, 2018, 5:08 p.m. UTC | #5
Hi Michael,

On Tue, Sep 18, 2018 at 02:03:29PM +1200, Michael Schmitz wrote:
> Thanks Dmitry!
> 
> I had asked Andreas' signoff for his keymap fixes only - the rewrite of the
> Atari keyboard driver to the current input framework (and hence the CapsLock
> toggle bug) was entirely mine, no blame attaches to Andreas there.

It was not about blame, it was about helping me to check the sanity of
the patch given I have no idea about the hardware ;)

Thanks.
diff mbox series

Patch

diff --git a/drivers/input/keyboard/atakbd.c b/drivers/input/keyboard/atakbd.c
index e989574..6caee80 100644
--- a/drivers/input/keyboard/atakbd.c
+++ b/drivers/input/keyboard/atakbd.c
@@ -185,14 +185,8 @@  static void atakbd_interrupt(unsigned char scancode, char down)
 
 		scancode = atakbd_keycode[scancode];
 
-		if (scancode == KEY_CAPSLOCK) {	/* CapsLock is a toggle switch key on Amiga */
-			input_report_key(atakbd_dev, scancode, 1);
-			input_report_key(atakbd_dev, scancode, 0);
-			input_sync(atakbd_dev);
-		} else {
-			input_report_key(atakbd_dev, scancode, down);
-			input_sync(atakbd_dev);
-		}
+		input_report_key(atakbd_dev, scancode, down);
+		input_sync(atakbd_dev);
 	} else				/* scancodes >= 0xf3 are mouse data, most likely */
 		printk(KERN_INFO "atakbd: unhandled scancode %x\n", scancode);