diff options
author | Jack Humbert <jack.humb@gmail.com> | 2016-11-28 23:51:07 -0500 |
---|---|---|
committer | Jack Humbert <jack.humb@gmail.com> | 2016-11-28 23:51:07 -0500 |
commit | 6e0f994950435aa5867e7b7ce780186d881d74ac (patch) | |
tree | 4a43aec89032a5bace8be91c3230b6d2fcedcb5f /readme.md | |
parent | 7edac212c8ed8442bf4207e70dc8194631b2bf27 (diff) | |
parent | 1585fc4b616cb28b8d4a418cd31c8ce0dd64f731 (diff) | |
download | qmk_firmware-6e0f994950435aa5867e7b7ce780186d881d74ac.tar.gz qmk_firmware-6e0f994950435aa5867e7b7ce780186d881d74ac.zip |
Merge branch 'master' of github.com:jackhumbert/qmk_firmware into wu5y7
Diffstat (limited to 'readme.md')
-rw-r--r-- | readme.md | 157 |
1 files changed, 156 insertions, 1 deletions
@@ -911,7 +911,33 @@ In `quantum/keymap_extras/`, you'll see various language files - these work the | |||
911 | 911 | ||
912 | ## Unicode support | 912 | ## Unicode support |
913 | 913 | ||
914 | You can currently send 4 hex digits with your OS-specific modifier key (RALT for OSX with the "Unicode Hex Input" layout, see [this article](http://www.poynton.com/notes/misc/mac-unicode-hex-input.html) to learn more) - this is currently limited to supporting one OS at a time, and requires a recompile for switching. 8 digit hex codes are being worked on. The keycode function is `UC(n)`, where *n* is a 4 digit hexidecimal. Enable from the Makefile. | 914 | There are three Unicode keymap definition method available in QMK: |
915 | |||
916 | ### UNICODE_ENABLE | ||
917 | |||
918 | Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in | ||
919 | keymap file, where *n* is a 4 digit hexadecimal. | ||
920 | |||
921 | ### UNICODEMAP_ENABLE | ||
922 | |||
923 | Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping | ||
924 | table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. | ||
925 | The keycode function is `X(n)` where *n* is the array index of the mapping | ||
926 | table. | ||
927 | |||
928 | ### UCIS_ENABLE | ||
929 | |||
930 | TBD | ||
931 | |||
932 | Unicode input in QMK works by inputing a sequence of characters to the OS, | ||
933 | sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted. | ||
934 | |||
935 | This is the current list of Unicode input method in QMK: | ||
936 | |||
937 | * UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. | ||
938 | * UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. | ||
939 | * UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. | ||
940 | * UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. | ||
915 | 941 | ||
916 | ## Backlight Breathing | 942 | ## Backlight Breathing |
917 | 943 | ||
@@ -1157,6 +1183,135 @@ The firmware supports 5 different light effects, and the color (hue, saturation, | |||
1157 | 1183 | ||
1158 | Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20. | 1184 | Please note the USB port can only supply a limited amount of power to the keyboard (500mA by standard, however, modern computer and most usb hubs can provide 700+mA.). According to the data of NeoPixel from Adafruit, 30 WS2812 LEDs require a 5V 1A power supply, LEDs used in this mod should not more than 20. |
1159 | 1185 | ||
1186 | ## PS/2 Mouse Support | ||
1187 | |||
1188 | Its possible to hook up a PS/2 mouse (for example touchpads or trackpoints) to your keyboard as a composite device. | ||
1189 | |||
1190 | Then, decide whether to use USART (best), interrupts (better) or busywait (not recommended), and enable the relevant option. | ||
1191 | |||
1192 | ### Busywait version | ||
1193 | |||
1194 | Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible. | ||
1195 | |||
1196 | In rules.mk: | ||
1197 | |||
1198 | ``` | ||
1199 | PS2_MOUSE_ENABLE = yes | ||
1200 | PS2_USE_BUSYWAIT = yes | ||
1201 | ``` | ||
1202 | |||
1203 | In your keyboard config.h: | ||
1204 | |||
1205 | ``` | ||
1206 | #ifdef PS2_USE_BUSYWAIT | ||
1207 | # define PS2_CLOCK_PORT PORTD | ||
1208 | # define PS2_CLOCK_PIN PIND | ||
1209 | # define PS2_CLOCK_DDR DDRD | ||
1210 | # define PS2_CLOCK_BIT 1 | ||
1211 | # define PS2_DATA_PORT PORTD | ||
1212 | # define PS2_DATA_PIN PIND | ||
1213 | # define PS2_DATA_DDR DDRD | ||
1214 | # define PS2_DATA_BIT 2 | ||
1215 | #endif | ||
1216 | ``` | ||
1217 | |||
1218 | ### Interrupt version | ||
1219 | |||
1220 | The following example uses D2 for clock and D5 for data. You can use any INT or PCINT pin for clock, and any pin for data. | ||
1221 | |||
1222 | In rules.mk: | ||
1223 | |||
1224 | ``` | ||
1225 | PS2_MOUSE_ENABLE = yes | ||
1226 | PS2_USE_INT = yes | ||
1227 | ``` | ||
1228 | |||
1229 | In your keyboard config.h: | ||
1230 | |||
1231 | ``` | ||
1232 | #ifdef PS2_USE_INT | ||
1233 | #define PS2_CLOCK_PORT PORTD | ||
1234 | #define PS2_CLOCK_PIN PIND | ||
1235 | #define PS2_CLOCK_DDR DDRD | ||
1236 | #define PS2_CLOCK_BIT 2 | ||
1237 | #define PS2_DATA_PORT PORTD | ||
1238 | #define PS2_DATA_PIN PIND | ||
1239 | #define PS2_DATA_DDR DDRD | ||
1240 | #define PS2_DATA_BIT 5 | ||
1241 | |||
1242 | #define PS2_INT_INIT() do { \ | ||
1243 | EICRA |= ((1<<ISC21) | \ | ||
1244 | (0<<ISC20)); \ | ||
1245 | } while (0) | ||
1246 | #define PS2_INT_ON() do { \ | ||
1247 | EIMSK |= (1<<INT2); \ | ||
1248 | } while (0) | ||
1249 | #define PS2_INT_OFF() do { \ | ||
1250 | EIMSK &= ~(1<<INT2); \ | ||
1251 | } while (0) | ||
1252 | #define PS2_INT_VECT INT2_vect | ||
1253 | #endif | ||
1254 | ``` | ||
1255 | |||
1256 | ### USART version | ||
1257 | |||
1258 | To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data. If one of those are unavailable, you need to use interrupt version. | ||
1259 | |||
1260 | In rules.mk: | ||
1261 | |||
1262 | ``` | ||
1263 | PS2_MOUSE_ENABLE = yes | ||
1264 | PS2_USE_USART = yes | ||
1265 | ``` | ||
1266 | |||
1267 | In your keyboard config.h: | ||
1268 | |||
1269 | ``` | ||
1270 | #ifdef PS2_USE_USART | ||
1271 | #define PS2_CLOCK_PORT PORTD | ||
1272 | #define PS2_CLOCK_PIN PIND | ||
1273 | #define PS2_CLOCK_DDR DDRD | ||
1274 | #define PS2_CLOCK_BIT 5 | ||
1275 | #define PS2_DATA_PORT PORTD | ||
1276 | #define PS2_DATA_PIN PIND | ||
1277 | #define PS2_DATA_DDR DDRD | ||
1278 | #define PS2_DATA_BIT 2 | ||
1279 | |||
1280 | /* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */ | ||
1281 | /* set DDR of CLOCK as input to be slave */ | ||
1282 | #define PS2_USART_INIT() do { \ | ||
1283 | PS2_CLOCK_DDR &= ~(1<<PS2_CLOCK_BIT); \ | ||
1284 | PS2_DATA_DDR &= ~(1<<PS2_DATA_BIT); \ | ||
1285 | UCSR1C = ((1 << UMSEL10) | \ | ||
1286 | (3 << UPM10) | \ | ||
1287 | (0 << USBS1) | \ | ||
1288 | (3 << UCSZ10) | \ | ||
1289 | (0 << UCPOL1)); \ | ||
1290 | UCSR1A = 0; \ | ||
1291 | UBRR1H = 0; \ | ||
1292 | UBRR1L = 0; \ | ||
1293 | } while (0) | ||
1294 | #define PS2_USART_RX_INT_ON() do { \ | ||
1295 | UCSR1B = ((1 << RXCIE1) | \ | ||
1296 | (1 << RXEN1)); \ | ||
1297 | } while (0) | ||
1298 | #define PS2_USART_RX_POLL_ON() do { \ | ||
1299 | UCSR1B = (1 << RXEN1); \ | ||
1300 | } while (0) | ||
1301 | #define PS2_USART_OFF() do { \ | ||
1302 | UCSR1C = 0; \ | ||
1303 | UCSR1B &= ~((1 << RXEN1) | \ | ||
1304 | (1 << TXEN1)); \ | ||
1305 | } while (0) | ||
1306 | #define PS2_USART_RX_READY (UCSR1A & (1<<RXC1)) | ||
1307 | #define PS2_USART_RX_DATA UDR1 | ||
1308 | #define PS2_USART_ERROR (UCSR1A & ((1<<FE1) | (1<<DOR1) | (1<<UPE1))) | ||
1309 | #define PS2_USART_RX_VECT USART1_RX_vect | ||
1310 | #endif | ||
1311 | #endif | ||
1312 | #endif | ||
1313 | ``` | ||
1314 | |||
1160 | ## Safety Considerations | 1315 | ## Safety Considerations |
1161 | 1316 | ||
1162 | You probably don't want to "brick" your keyboard, making it impossible | 1317 | You probably don't want to "brick" your keyboard, making it impossible |