Linux console tools development discussion
 help / color / mirror / Atom feed
* Re: [kbd] [PATCH 0/5] Add Apple USB keyboard models A1048 and A1243, Swedish localization
  @ 2018-10-22  8:49 ` Alexey Gladkov
    2019-01-06  8:37   ` Fredrik Noring
  0 siblings, 2 replies; 3+ messages in thread
From: Alexey Gladkov @ 2018-10-22  8:49 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: kbd

On Thu, Oct 11, 2018 at 04:12:19PM +0200, Fredrik Noring wrote:
> Hi,
> 
> This patch series adds keymaps for Apple USB keyboard models A1048 and
> A1243, localized for Swedish. The internal USB keyboard mapping for the
> MacBook 2011 is also added.
> 
> The mappings are designed to correspond to standard Apple keys, including
> the behaviour of the shift and the alternate keys.
> 
> The top row keys with printed feature icons are normally used to control
> features such as volume adjustments in macOS. They can also be used as
> function keys (F1-F19) by holding the Fn key. The default behaviour of
> the Fn key can be reversed.
> 
> The presence of these keyboards can probably be detected reliably by
> their USB identification numbers and country code, annotated in the map
> file notes. An autodetection implementation would be very helpful for
> users.
> 
> For some reason, mapping U+FB01 for LATIN SMALL LIGATURE FI and U+FB02
> for LATIN SMALL LIGATURE FL yield the error
> 
> 	unicode keysym out of range: U+FB01
> 	syntax error, unexpected ERROR, expecting EOL
> 	unicode keysym out of range: U+FB02
> 	syntax error, unexpected ERROR, expecting EOL
> 
> from loadkeys(1). These are marked as FIXME in the map file.
> 
> Fredrik
> 
> Fredrik Noring (5):
>   Add Apple USB keyboard model A1048 with keypad, plastic, Swedish
>   Add Apple USB keyboard model A1243 with keypad, aluminium, Swedish
>   Add Apple USB keyboard model A1243, Swedish, reverse function keys
>   Add Apple USB keyboard/trackpad (ISO), Swedish
>   Add Apple USB keyboard/trackpad (ISO), Swedish, reverse function keys
> 
>  data/keymaps/mac/all/apple-a1048-sv.map            | 70 ++++++++++++++++++
>  data/keymaps/mac/all/apple-a1243-sv-fn-reverse.map | 13 ++++
>  data/keymaps/mac/all/apple-a1243-sv.map            | 17 +++++
>  .../all/apple-internal-0x0253-sv-fn-reverse.map    | 15 ++++
>  data/keymaps/mac/all/apple-internal-0x0253-sv.map  | 15 ++++
>  data/keymaps/mac/include/apple-a1048-base.inc      | 85 ++++++++++++++++++++++
>  .../keymaps/mac/include/apple-a1243-fn-reverse.inc | 51 +++++++++++++
>  data/keymaps/mac/include/apple-a1243-fn.inc        | 52 +++++++++++++
>  8 files changed, 318 insertions(+)
>  create mode 100644 data/keymaps/mac/all/apple-a1048-sv.map
>  create mode 100644 data/keymaps/mac/all/apple-a1243-sv-fn-reverse.map
>  create mode 100644 data/keymaps/mac/all/apple-a1243-sv.map
>  create mode 100644 data/keymaps/mac/all/apple-internal-0x0253-sv-fn-reverse.map
>  create mode 100644 data/keymaps/mac/all/apple-internal-0x0253-sv.map
>  create mode 100644 data/keymaps/mac/include/apple-a1048-base.inc
>  create mode 100644 data/keymaps/mac/include/apple-a1243-fn-reverse.inc
>  create mode 100644 data/keymaps/mac/include/apple-a1243-fn.inc

You put the product ID in the filename. Do you think the keycodes will be
unique for each product?

-- 
Rgrds, legion



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

* Re: [kbd] [PATCH 0/5] Add Apple USB keyboard models A1048 and A1243, Swedish localization
  @ 2018-10-24 15:14     ` Alexey Gladkov
  0 siblings, 0 replies; 3+ messages in thread
From: Alexey Gladkov @ 2018-10-24 15:14 UTC (permalink / raw)
  To: Fredrik Noring; +Cc: kbd

On Mon, Oct 22, 2018 at 05:37:38PM +0200, Fredrik Noring wrote:
> Hi Alexey,
> 
> > You put the product ID in the filename. Do you think the keycodes will be
> > unique for each product?
> 
> For Apple keyboards (at least), I hope that the USB triplet idVendor,
> idProduct, and bCountryCode can distinctly indicate the proper keymap.
> 
> Most variations are due to bCountryCode (localization), with minor
> differences for idProduct (such as the difference between keycodes 41
> and 86 for Apple models A1048 and A1243, for example). I would be
> surprised if they reused idProduct for incompatible products.
> 
> It would be very helpful if the kernel could automatically select the
> corresponding keymap when recognising a known USB-keyboard product.

OK. Applied. Thanks!

-- 
Rgrds, legion



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

* Re: [kbd] [PATCH 0/5] Add Apple USB keyboard models A1048 and A1243, Swedish localization
  2018-10-22  8:49 ` [kbd] [PATCH 0/5] Add Apple USB keyboard models A1048 and A1243, Swedish localization Alexey Gladkov
  @ 2019-01-06  8:37   ` Fredrik Noring
  1 sibling, 0 replies; 3+ messages in thread
From: Fredrik Noring @ 2019-01-06  8:37 UTC (permalink / raw)
  To: Alexey Gladkov; +Cc: kbd

Hi Alexey,

> > The top row keys with printed feature icons are normally used to control
> > features such as volume adjustments in macOS. They can also be used as
> > function keys (F1-F19) by holding the Fn key. The default behaviour of
> > the Fn key can be reversed.

I have discovered a better way to reverse the function keys. It turns out
that the keys can be reversed by the setting the fnmode parameter to 2 for
the apple_hid kernel module. This can be done by for example

# echo 2 >/sys/module/hid_apple/parameters/fnmode

One advantage with this method (as opposed to the reversed keymap files)
is that the function keys remain reversed with X11 as well. The apple_hid
kernel module needs to loaded regardless.

> >  data/keymaps/mac/all/apple-a1048-sv.map            | 70 ++++++++++++++++++
> >  data/keymaps/mac/all/apple-a1243-sv-fn-reverse.map | 13 ++++
> >  data/keymaps/mac/all/apple-a1243-sv.map            | 17 +++++
> >  .../all/apple-internal-0x0253-sv-fn-reverse.map    | 15 ++++
> >  data/keymaps/mac/all/apple-internal-0x0253-sv.map  | 15 ++++
> >  data/keymaps/mac/include/apple-a1048-base.inc      | 85 ++++++++++++++++++++++
> >  .../keymaps/mac/include/apple-a1243-fn-reverse.inc | 51 +++++++++++++
> >  data/keymaps/mac/include/apple-a1243-fn.inc        | 52 +++++++++++++
> >  8 files changed, 318 insertions(+)

Therefore I suggest that we remove the map files named apple-*-reverse.*
and instead refer to the use of the fnmode parameter. Would you agree?

Fredrik


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

end of thread, other threads:[~2019-01-06  8:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-22  8:49 ` [kbd] [PATCH 0/5] Add Apple USB keyboard models A1048 and A1243, Swedish localization Alexey Gladkov
2018-10-24 15:14     ` Alexey Gladkov
2019-01-06  8:37   ` Fredrik Noring

Linux console tools development discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/kbd/0 kbd/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kbd kbd/ http://lore.altlinux.org/kbd \
		kbd@lists.altlinux.org kbd@lists.altlinux.ru kbd@lists.altlinux.com
	public-inbox-index kbd

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.kbd


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git