Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#7964 closed enhancement (fixed)

Apple Aluminum Keyboard Layout files

Reported by: jscipione Owned by: axeld
Priority: normal Milestone: R1
Component: Preferences/Keymap Version: R1/Development
Keywords: Cc: andreasf
Blocked By: Blocking:
Platform: All

Description

This ticket adds US and international keyboard layouts for the Apple Aluminum keyboard. I included both regular and extended versions. The Extended International version already exists but I renamed it from "Apple Aluminium" to "Apple Aluminium Extended International." Notice that the British spelling of Aluminium was kept for the international versions. I also updated the key codes to reflect what is produced by the hardware. That is F13-F19 produce key codes 0x70068-0x7006e. I also removed the eject key and the fn key from the layout since these keys do not produce any keycode in Haiku and thus are unmappable.

Apple Aluminium Extended International Keyboard Layout file Apple Aluminium International Keyboard Layout Apple Aluminum (US) Keyboard Layout Apple Aluminum Extended (US) Keyboard Layout

Attachments (13)

Apple Aluminium International Keyboard Layout.png (50.4 KB ) - added by jscipione 13 years ago.
Apple Aluminium International Keyboard Layout
Apple Aluminum (US) Keyboard Layout.png (50.5 KB ) - added by jscipione 13 years ago.
Apple Aluminum (US) Keyboard Layout
Apple Aluminum Extended (US) Keyboard Layout.png (45.9 KB ) - added by jscipione 13 years ago.
Apple Aluminum Extended (US) Keyboard Layout
Apple Aluminium International (660 bytes ) - added by jscipione 13 years ago.
Apple Aluminium International Keyboard Layout file
Apple Aluminum (US) (596 bytes ) - added by jscipione 13 years ago.
Apple Aluminum (US) Keyboard Layout file
Apple Aluminium Extended International Keyboard Layout.png (45.5 KB ) - added by jscipione 13 years ago.
Apple Aluminium Extended International Keyboard Layout file
Apple Aluminium Extended International (832 bytes ) - added by jscipione 13 years ago.
Apple Aluminium Extended International Keyboard Layout file
Apple Aluminum Extended (US) (795 bytes ) - added by jscipione 13 years ago.
Apple Aluminum Extended (US) Keyboard Layout file
Keymap_add_Apple_Aluminum_submenu_1.diff (9.3 KB ) - added by jscipione 13 years ago.
This patch adds the 4 new Apple Aluminum Keyboard Layout files to a submenu in the keymap app called "Apple Aluminum" and remove the original "Apple Aluminium" layout file. The keyboard layout files are added to HaikuImage individually instead of adding all the files in the data/system/data/KeyboardLayouts directory.
Keyboard Layout Apple Aluminum Submenu.png (47.9 KB ) - added by jscipione 13 years ago.
Screenshot showing the Apple Aluminum subdirectory in the Layout menu of the keymap preference app
Keymap_add_Apple_Aluminum_submenu_2.diff (12.1 KB ) - added by jscipione 13 years ago.
This patch builds on the last patch adding the new Apple Aluminum keyboard layout files to the keymap app. In the last patch marking the menu option was not working correctly. This fixes the menu marking so that it will mark the correct item even if that item is in a submenu. The Layout menu is no longer in RadioMode because that doesn't work with submenus. Instead I go through the menu and mark and unmark items appropriately. Yes there is a goto in the patch but it is not bad. The goto breaks out of an inner loop which is appropriate. The layout menu items are sorted alphabetically even the default Generic 105-key International layout but since I am a bit smarter about finding the default one it no longer has to be the first item in the list.
HaikuImage_add_Apple_Aluminum_keyboard_layout_files_to_subdir_1.diff (1.7 KB ) - added by jscipione 13 years ago.
This patch modifies HaikuImage to add each of the keyboard layout files in the data/system/data/KeyboardLayouts/ dir one-by-one. The Apple Aluminum Keyboard Layout files in this dir are added to an "Apple Aluminum" subdir in the image. The subdirectory is turned into a submenu in the Keymap preference app.
Keymap_add_Apple_Aluminum_submenu_3.diff (7.1 KB ) - added by jscipione 13 years ago.
Adds the ability to turn subdirectories in the KeyboardLayouts/ directories into submenus in the Layout menu of the Keymap preference app. This patch uses recursive methods removing the limitation of only handling 1 level of subdirs. The code is much cleaner than the _2 version. No goto required. I had to remove the const qualifier on the _SaveSettings() menu to allow it to call a recursive method to find the path of the marked layout. This patch is different than versions 1 and 2 in that it only deals with turning subdirs into submenus and doesn't include the Apple Aluminum layout files or the changes to HaikuImage.

Download all attachments as: .zip

Change History (23)

by jscipione, 13 years ago

Apple Aluminium International Keyboard Layout

by jscipione, 13 years ago

Apple Aluminum (US) Keyboard Layout

by jscipione, 13 years ago

Apple Aluminum Extended (US) Keyboard Layout

by jscipione, 13 years ago

Apple Aluminium International Keyboard Layout file

by jscipione, 13 years ago

Attachment: Apple Aluminum (US) added

Apple Aluminum (US) Keyboard Layout file

by jscipione, 13 years ago

Apple Aluminium Extended International Keyboard Layout file

by jscipione, 13 years ago

Apple Aluminium Extended International Keyboard Layout file

by jscipione, 13 years ago

Apple Aluminum Extended (US) Keyboard Layout file

comment:1 by jscipione, 13 years ago

I updated the extended keyboard layout files slightly so that the F13-19 keys will not have the dark appearance.

by jscipione, 13 years ago

This patch adds the 4 new Apple Aluminum Keyboard Layout files to a submenu in the keymap app called "Apple Aluminum" and remove the original "Apple Aluminium" layout file. The keyboard layout files are added to HaikuImage individually instead of adding all the files in the data/system/data/KeyboardLayouts directory.

comment:2 by jscipione, 13 years ago

patch: 01

by jscipione, 13 years ago

Screenshot showing the Apple Aluminum subdirectory in the Layout menu of the keymap preference app

by jscipione, 13 years ago

This patch builds on the last patch adding the new Apple Aluminum keyboard layout files to the keymap app. In the last patch marking the menu option was not working correctly. This fixes the menu marking so that it will mark the correct item even if that item is in a submenu. The Layout menu is no longer in RadioMode because that doesn't work with submenus. Instead I go through the menu and mark and unmark items appropriately. Yes there is a goto in the patch but it is not bad. The goto breaks out of an inner loop which is appropriate. The layout menu items are sorted alphabetically even the default Generic 105-key International layout but since I am a bit smarter about finding the default one it no longer has to be the first item in the list.

by jscipione, 13 years ago

This patch modifies HaikuImage to add each of the keyboard layout files in the data/system/data/KeyboardLayouts/ dir one-by-one. The Apple Aluminum Keyboard Layout files in this dir are added to an "Apple Aluminum" subdir in the image. The subdirectory is turned into a submenu in the Keymap preference app.

by jscipione, 13 years ago

Adds the ability to turn subdirectories in the KeyboardLayouts/ directories into submenus in the Layout menu of the Keymap preference app. This patch uses recursive methods removing the limitation of only handling 1 level of subdirs. The code is much cleaner than the _2 version. No goto required. I had to remove the const qualifier on the _SaveSettings() menu to allow it to call a recursive method to find the path of the marked layout. This patch is different than versions 1 and 2 in that it only deals with turning subdirs into submenus and doesn't include the Apple Aluminum layout files or the changes to HaikuImage.

comment:3 by jscipione, 13 years ago

I have decided to split up the patch into a couple of patches so there is now some assembly required. To apply the changes, copy the attached layout files to your data/system/data/KeyboardLayouts/ dir. Note, don't create a subdir for the Apple Aluminum files, that is now done in HaikuImage for you. You should also probably delete the existing 'Apple Aluminium' keymap file since it is obsolete, however, it won't hurt if you don't since that keyboard layout files won't be added to the image once the HaikuImage patch is applied anyway.

Next apply the HaikuImage patch to include the layout files into the image. The patch will create an 'Apple Aluminum' subdirectory in the system/data/KeyboardLayouts/ directory of the corresponding image.

Finally apply the submenu patch to get the Keymap preference app to recognize subdirs as submenus in the Layout menu. The restriction of only allowing 1 subdir is lifted so this patch will allow you to potentially have multiple levels of submenus in the future. This is only really useful if we get a lot more layout files but it is the right thing to do (tm).

comment:4 by andreasf, 13 years ago

Cc: andreasf added

comment:5 by axeld, 13 years ago

The source directory layout mostly tries to correspond to the one on the image. In that regard, I would prefer to have the Apple keyboard layout files in a subfolder when they appear on the image that way, too. The more files there end up being there, the more crowded it gets there.

in reply to:  5 comment:6 by jscipione, 13 years ago

Replying to axeld:

The source directory layout mostly tries to correspond to the one on the image. In that regard, I would prefer to have the Apple keyboard layout files in a subfolder when they appear on the image that way, too. The more files there end up being there, the more crowded it gets there.

src/bin has a lot of files in it too, but the point is that the files are organized well in the resulting image. I don't see it as a problem that that directory becomes crowded but it isn't hard to organize the layout files into folders.

comment:7 by axeld, 13 years ago

src/bin has a lot of files, but they end up in /bin, not in a subfolder, so that case isn't really comparable. But that's just my opinion, and I think both ways are acceptable in the end. The rest looks good to me.

Anyway, since you made it so hard to apply this by separating it into like 6 different files, I let you apply it once you have commit access yourself, okay? :-)

in reply to:  7 comment:8 by jscipione, 13 years ago

Replying to axeld:

src/bin has a lot of files, but they end up in /bin, not in a subfolder, so that case isn't really comparable.

You are right, it is not comparable, but it is okay to have a directory with a lot of files in it. To folder or not to folder, that is the question.

Anyway, since you made it so hard to apply this by separating it into like 6 different files, I let you apply it once you have commit access yourself, okay? :-)

I split it into several files so that you could apply and test each piece separately. Sure, I have no problems committing once I have commit access. :)

comment:9 by jscipione, 13 years ago

Resolution: fixed
Status: newclosed

comment:10 by axeld, 13 years ago

Fixed in hrev43093.

Note: See TracTickets for help on using tickets.