- The Apple Wireless Keyboard is a wireless keyboard built for Macintosh computers and compatible with iOS devices. It interacts over Bluetooth wireless technology and unlike its wired version, it has no USB connectors or ports.
- You will then see a popup window that offers a passcode. This is when the setup for the two types of Apple wireless keyboards differs. If you have the older Wireless Keyboard, simply type the code.
To connect a Magic Keyboard to your Mac, iPhone, iPad, or Apple TV, enable Bluetooth and then press the power button on the keyboard. Once the devices pair, the keyboard will be ready to use. Turn on the Magic Keyboard. The power button is.
(Redirected from Bluetooth Keyboard)
This article describes how to set up a Bluetooth HID keyboard with Arch Linux, bluez version 5.
Pairing process
This article or section is a candidate for merging with Bluetooth.
Notes: Pairing process, and some troubleshooting related to it, are redundant with general device setup on Bluetooth page, and should be merged there. Keyboard-specific info would stay on this page. (Discuss in Talk:Bluetooth#Merging general setup from Keyboard, Mouse, Headset pages)
Login to the affected computer by a wired keyboard or by ssh.
First, make sure the local BT controller (e.g. a BT dongle the built in BT radio) is recognized:
The above output is from a Raspberry-Pi revision 'B' with archlinux-arm and a Keysonic BT Dongle.
Three items worth remembering:
- BT devices (keyboard) and controllers (dongle) need to be paired once.
- The BT controller needs to be powered up after every boot.
- The BT controller needs to be told to connect to the keyboard after every boot.
Pairing is a one time process, required only once. There are BT keyboards sold with a BT dongle which come already paired, but that's not certain. We will use the
bluetoothctl
command from bluez-utils to pair our dongle and the keyboard. Power up can be done with
bluetoothctl
, or automatically in /etc/bluetooth/main.conf
, see below.Same for connecting, either
bluetoothctl
or hcitool
can be used, the latter is more useful for scripting.We will use
bluetoothctl
for the pairing process. Run the command to get at the [bluetooth]#
prompt.Note: If you are on a color console: the word 'bluetooth' is in the default color as long as no devices are available, and blue as soon as required devices and/or controllers have been found.
While in bluetoothctl power up the controller:
Next, tell
bluetoothctl
to look only for keyboards, and make that the default agent:Next, put your controller (the local dongle) in pairable mode:
Next, put your keyboard in an active mode, where it is discoverable, i.e. pairable. Some keyboards have a special button for this on the underside, or require a special key combination to be pressed. See the documentation of your keyboard. Please note that this discoverability of a device is time limited, some devices are only visible 30 seconds, other for 2 minutes. Your mileage may vary.
Next, let the controller scan the BT frequencies for a suitable device:
After a few seconds the adress of the keyboard should be listed as found. This line will repeat over and over, but won't stop you from entering new commands.
Next, actually do the pairing. The address used is the BT-MAC address of the keyboard:
Note: Some keyboards, such as Microsoft Surface Ergonomic, will send a pass code (e.g. '[agent] Passkey: 501334') which has to be typed in on the bluetooth keyboard followed by the key Enter in order to pair successfully. Use 'paired-devices' command to double check if the pairing succeeded.
Next, make this a trusted device (this allows the device to establish the connection on itself). Again, the BT-MAC address is the address of the keyboard device:
Next and finally connect to the device (keyboard). Again, the BT-MAC address is the address of the keyboard device:
Done. Leave the
bluetoothctl
utility:Now the external device (i.e. keyboard) and the USB BT dongle are paired permanently, unless you break the pairing intentionally. This does not mean that the keyboard will connect automatically to your BT device after a boot. This is mainly due to the fact that the bluetooth controller will be automatically turned off after each reboot. To automatically connect the keyboard after a reboot, see Bluetooth#Auto power-on after boot.
Troubleshooting
This article or section needs expansion.
What if the BT controller does not show up in
lsusb
?- Load generic bluetooth driver:
- Is it an USB adapter or integral to the system? Use
lspci
for integral adapters
What if the BT controller is not visible in
bluetoothctl
?- Check:
bluetoothctl
is started:
- Check: You run the command with superuser privileges using
su
orsudo
. Otherwise you have blue [bluetooth]# prompt and get the following message when powering on the controller:
My BT keyboard still does not work. What to do?
- Check: Does it have power?
- Check: Did it connect to the BT controller? If not, try with another controller or your smart phone.
All went fine but when I type I'm getting 'Bluetooth: hci0 ACL packet for unknown connection handle 4' Steermouse 5 0 8 download free.
- Try reset: hciconfig hci0 reset
Xorg
Device should be added as
/dev/input/event*
and your Xorg should add it automatically if you did not disable such feature.Retrieved from 'https://wiki.archlinux.org/index.php?title=Bluetooth_keyboard&oldid=637688'
Some Apple keyboard models may have swapped keys or missing functionality. This article describes how to change the settings for the keyboard so that it behaves as expected.
![Wireless keyboard for apple computer Wireless keyboard for apple computer](https://hotemoji.com/images/dl/5/microphone-emoji-by-google.png)
- 10Treating Apple keyboards like regular keyboards
- 10.1Use a patch to hid-apple
Numlock is on
You may find that the numlock is on. The symptoms are that only the physical keys
7
,8
,9
,u
,i
,o
,j
,k
,l
and surrounding keys work and output numbers. To fix this hit Fn+F6
twice.Alternatively, set the keycodes manually using xmodmap to avoid use Numlock:
Repeating keys on a wireless keyboard
Unpair the keyboard and then re-pair it. The trick is to hold down the power button throughout the entire pairing process.
hid_apple module options
- fnmode - Mode of top-row keys
- swap_opt_cmd - Swap the Option ('Alt') and Command ('Flag') keys
- iso_layout - Enable/Disable hardcoded ISO-layout of the keyboard. Possibly relevant for international keyboard layouts
- swap_fn_leftctrl - Swap the Fn and left Control keys
Function keys do not work
If your
F<num>
keys do not work, this is probably because the kernel driver for the keyboard has defaulted to using the media keys and requiring you to use the Fn
key to get to the F<num>
keys. To change the behavior temporarily, append2
to /sys/module/hid_apple/parameters/fnmode
.To make the change permanent, set the
hid_apple
fnmode
option to 2:To apply the change to your initial ramdisk, in your mkinitcpio configuration (usually
/etc/mkinitcpio.conf
), make sure you either have modconf
included in the HOOKS
variable or /etc/modprobe.d/hid_apple.conf
in the FILES
variable. You would then need to regenerate the initramfs.Switching Cmd and Alt/AltGr
This will switch the left
Alt
and Cmd
key as well as the right Alt
/AltGr
and Cmd
key.Temporary and immediate solution:
Permanent change, taking place at next reboot:
You then need to regenerate the initramfs.
Old Apple Wireless Keyboard
Swap the Fn and left Control keys
This will switch the
Fn
and left Control
keys.Temporary and immediate solution:
Permanent change, taking place at next reboot:
You then need to regenerate the initramfs.
< and > have changed place with § and ½
If the < and > are switched with the § and ½ keys, set the xkb option
apple:badmap
, for instance by running the following command in your graphical environment:Alternatively, set the keycodes manually using xmodmap:
If you use a Canadian multilingual layout (where the 'ù' and the '/' is switch) use this: Textpad 1 8 14 inch.
< and > have changed place with ^ and ° (or @ and #, or ` and ~)
With German layout, circumflex/degree symbol and </> are exchanged. With French layout, @/# are exchanged. With the US layout, `/~ and </> are exchanged.
To change the behavior temporarily, overwrite
/sys/module/hid_apple/parameters/iso_layout
with 0
:To make the change permanent, set the
hid_apple
iso_layout
option to 0:You then need to regenerate the initramfs.
PrintScreen and SysRq
Apple Keyboards have an
F13
key instead of a PrintScreen
/SysRq
key. This means that Alt+SysRq sequences do not work, and application actions associated with PrintScreen
(such as taking screenshots in many games that work under Wine) do not work. To fix this, you can add setxkbmap -option 'apple:alupckeys'
to your .xinitrc
. This will map PrintScreen
/SysRq
to F13
, as well as Scroll lock
to F14
and Pause
to F15
.Alternatively, follow the Map scancodes to keycodes article to map the
F13
scancode to the PrintScreen
/SysRq
keycode, where 458856 (0x070068) is the scancode of F13
, and sysrq
is the keycode of PrintScreen
/SysRq
.Treating Apple keyboards like regular keyboards
Depending on the customisations you want to accomplish, there are two solutions available and some options that are in the kernel. You need to choose one of the other.
Use a patch to hid-apple
While the original
hid-apple
module does not have options to further customize the keyboard, like swapping Fn
and left Ctrl
keys or having Alt
on the left side of Super
, there is a patched version adding this functionality to the module. To use it, install the hid-apple-patched-git-dkmsAUR package. This will install the patched hid-apple
and mask out the original one.The package uses DKMS to automatically recompile the module during kernel upgrades. While the dkms will be pulled in by dependency. You still need to install an appropriate kernel header package manually. See the DKMS page for more info.
In addition to the patched kernel module, a configuration file is also provided by the package at
/usr/lib/modprobe.d/hid_apple.conf
, which enables PC-like layout by default:- Top-row keys are normally function keys, switchable to media keys by holding Fn key, as in #Function keys do not work.
- Four keys at the lower left corner act as
Ctrl
,Fn
,Super
,Alt
, in this order. - Two keys at the lower right corner act as
Alt
,Ctrl
, in this order. - If you have an
Ejectcd
key, it will act asDelete
key.
If you wish to change the default options, copy the configuration file to
/etc/modprobe.d
and make desired changes:The file under
/etc/modprobe.d
will completely override the one with the same name under /usr/lib/modprobe.d
, and the content is NOT merged.Alternatively, put additional options in a file with a different name if you want to keep default ones,
Note: Do not forget to update initramfs after manual changes to configuration files.
Please refer to the project README for the exact meaning of each configuration option and tweaking the configuration file to suit your needs. Learn more about
modprobe.d
at Kernel module#Using files in /etc/modprobe.d/.After installation, reboot for the change to take effect, or #Change the Behavior Without Reboot.
Troubleshooting configuration not picked up by the module
Apple Wireless Keyboard Wikipedia
First, make sure the patched version is loaded, see what parameters are provided by the module:
If you don't see new options like
swap_fn_leftctrl
, ejectcd_as_delete
, etc., check your dkms installation.Then, check if configuration files are correctly included in initramfs:
Check the presence and content of
inintramfs/usr/lib/modprobe.d/hid_apple.conf
and any other relevant configuration files in inintramfs/etc/modprobe.d
. If they are not there, you should check your /etc/mkinitcpio.conf
to include those. By default, there shouldbe a modconf
hook that automatically include those files, if not, add it to the HOOKS
array after autodetect
.Alternatively, list those files in
FILES
array explicitly:Refer to Mkinitcpio#BINARIES and FILES and Mkinitcpio#HOOKS for more explanation on what this means.
Finally, rebuild the initramfs and reboot.
Use un-apple-keyboard
If you do not need all of these customizations and you do not want to compile a new module manually or using dkms, there is an AUR package un-apple-keyboardAUR which does not rely on a new kernel module, but rather just to mappings. It enables the following features:
Pin For Apple Wireless Keyboard
- The keyboard is considered as an ISO keyboard (e.g.
<
and>
located at the right of theLeft Shift
key are working like expected). - The function keys are disabled by default. You need to press the
Fn
key in combination to trigger them. By default, the behavior are thus keysF1
toF12
- The
Alt
andCmd
keys are swapped. F13
is mapped toSYSRQ
,F14
toScroll Lock
andF15
toPause
.
The first 3 aforementioned features are brought to you using the default linux kernel module
hid-apple
.The last one is provided by providing a mapping to keyfuzzAUR.
Change the Behavior Without Reboot
Warning: If the builtin keyboard and touch pad are the only input device, beware that doing so might leave your computer in an inoperable state unless hard reboot when the second command failes.
To reload the kernel module without reboot, run
rmmod hid_apple && modprobe hid_apple
.Magic Keyboard does not connect
If you have a magic keyboard that will not connect to the system through the built in tools, such as the Gnome 3 bluetooth menu in settings, install blueman and its dependencies and attempt to connect with it. If it still fails to connect, make sure you have bluetoothctl and hcitool installed.
Enable dvorak/dvp
By default xkb loads translation table (actually called
xkb_symbols
) macintosh_vndr/us
for macintosh keyboard:This translation table located in
/usr/share/X11/xkb/symbols/macintosh_vndr/us
and don't contains dvorak/dvp layout. You can use default translation table from /usr/share/X11/xkb/symbols/us
and add command setxkbmap
in your .profile
for forced loading layout:See also
Retrieved from 'https://wiki.archlinux.org/index.php?title=Apple_Keyboard&oldid=637172'