All of lore.kernel.org
 help / color / mirror / Atom feed
From: Henrik Carlqvist <hc981@poolhem.se>
To: Henrik Carlqvist <hc981@poolhem.se>
Cc: mark.cave-ayland@ilande.co.uk, hc1245@poolhem.se, qemu-devel@nongnu.org
Subject: Re: [PATCH v5] Emulate dip switch language layout settings on SUN keyboard
Date: Sat, 4 Mar 2023 22:07:54 +0100	[thread overview]
Message-ID: <20230304220754.0c6ae562.hc981@poolhem.se> (raw)
In-Reply-To: <20230123200937.32eb19eb.hc981@poolhem.se>

On Wed, 1 Mar 2023 11:52:42 +0000
Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> wrote:
> I've done a quick grep for similar examples for serial devices that use
> keyboard_layout but it looks like this would be the first. 

Thanks again for your reply!

It is probably not a very common solution with hardware in the keyboard
telling the computer about its language layout. Maybe it is even less common
with such hardware possible to adjust with a dip switch to choose language
layout. But that was the solution Sun selected for their keybords back in the
days and back then (and even still today) it was common for keyboards to
communicate with the computer by some kind of serial interface.

> My first instinct is that you'd want to make this a device property that is
> configured during machine init using keyboard_layout (rather than using
> keyboard_layout directly),

If it does matter in any way, my patch will only at first call to the
sun_keyboard_layout_dip_switch function look at the keyboard_layout variable.
Once the static "ret" variable has gotten a valid value (the initial value
0xff is not valid for a 6-bit dip swithc) the ret value assigned at the
initial call will be immediately returned without any more evaluations of the
keyboard_layout string.

> but I'd be interested to hear what Paolo and Marc-André think about what the
> best approach should be.

As I found your latest reply only on
https://lists.nongnu.org/archive/html/qemu-devel/2023-03/msg00097.html and
can't see the email addresses of any receiver of that post this reply does not
go to Paolo or Marc-André, only to you and the mailing list.

I must admit that I am not very failiar with qemu programming and device
properties. 

> Another aspect to consider is whether keyboard_layout should just use
> standard strings, in which case it may not make sense to accept numeric hex
> values. 

I agree that those standard strings will make most sense to most people.

However, as the choices of valid keyboard layouts are limited by the 64 values
allowed by the 6 bits on the dip switch I initially did choose to also truly
emulate the dip switch value as decimal or hexadecimal number to the -k
option. It might also be worth noting that the sun keyboard layouts have
multiple dip switch settings for a single language, probably with some minor
differences in keyboard layout or keyboard type. So both value 8 and 40 (0x28)
will give some norwegian keyboard layout. if someone, for some reason, would
want to emulate for example one of the four possible US keyboard layouts (0x0,
0x1, 0x21 or 0x22) it would be harder to do without being able to give those
numerical values to the -k switch.

best regards Henrik


  reply	other threads:[~2023-03-04 21:08 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07  2:37 [PATCH qemu v3 0/1] [PATCH v3] Emulate dip switch language layout settings on SUN keyboard ~henca
2023-01-06 21:33 ` [PATCH qemu v3 1/1] Emulating sun keyboard language layout dip switches, taking the value for the dip switches from the "-k" option to qemu ~henca
2023-01-10 23:08   ` Mark Cave-Ayland
2023-01-23 19:09     ` [PATCH v5] Emulate dip switch language layout settings on SUN keyboard Henrik Carlqvist
2023-03-04 21:07       ` Henrik Carlqvist [this message]
2023-03-28 14:01         ` Daniel P. Berrangé
2023-03-28 17:19           ` Henrik Carlqvist
2023-03-28 17:59             ` Daniel P. Berrangé
2023-03-28 20:16               ` Henrik Carlqvist
2023-04-30 20:55                 ` [PATCH v6] " Henrik Carlqvist
2023-06-08 16:14                   ` Ping: " Henrik Carlqvist
2023-06-10  7:06                     ` Mark Cave-Ayland
2023-06-10 10:29                       ` Henrik Carlqvist
2023-06-10 23:47                         ` [PATCH v7] " Henrik Carlqvist
2023-06-20  9:22                           ` Daniel P. Berrangé
2023-06-20 19:50                             ` Henrik Carlqvist
2023-06-21  7:09                               ` Daniel P. Berrangé
2023-06-21 18:14                                 ` Henrik Carlqvist
2023-06-23 18:30                                   ` [PATCH v8] " Henrik Carlqvist
2023-06-26  9:42                                     ` Daniel P. Berrangé
2023-06-27  6:33                                     ` Mark Cave-Ayland
2023-06-27 17:18                                       ` Henrik Carlqvist
2023-08-01 21:27                                     ` [PATCH v1] Allowing setting and overriding parameters in smb.conf Henrik Carlqvist
2023-08-02 19:53                                       ` Samuel Thibault
2023-08-02 23:09                                         ` Henrik Carlqvist
2023-08-02 23:13                                           ` Samuel Thibault
2023-08-02 23:26                                             ` Henrik Carlqvist
2023-08-02 23:34                                               ` Samuel Thibault
2023-08-03  0:13                                                 ` Henrik Carlqvist
2023-08-03 15:12                                                 ` [PATCH v2] " Henrik Carlqvist
2023-09-10 11:48                                                   ` Ping: " Henrik Carlqvist
2024-02-17 22:28                                                     ` Ping 2: " Henrik Carlqvist
2024-02-18  9:30                                                       ` Michael Tokarev
2024-02-18 14:55                                                         ` Henrik Carlqvist
2023-06-08 16:22                   ` [PATCH v6] Emulate dip switch language layout settings on SUN keyboard Daniel P. Berrangé
2023-06-08 18:12                     ` Henrik Carlqvist
2023-06-09  7:50                       ` Daniel P. Berrangé
2023-01-14 11:50 [PATCH v4] " Henrik Carlqvist
2023-01-14 14:38 ` [PATCH v5] " Henrik Carlqvist
2023-01-22 18:07   ` Mark Cave-Ayland
2023-01-28 13:08     ` Henrik Carlqvist
2023-03-28 13:47   ` Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230304220754.0c6ae562.hc981@poolhem.se \
    --to=hc981@poolhem.se \
    --cc=hc1245@poolhem.se \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.