Merge remote-tracking branch 'origin/develop' into xap

This commit is contained in:
QMK Bot 2023-07-07 14:27:50 +00:00
commit 9b5b2b6455
5 changed files with 215 additions and 173 deletions

View File

@ -101,7 +101,7 @@ This is an extension of the accelerated mode. The kinetic mode uses a quadratic
Tips:
* The smoothness of the cursor movement depends on the `MOUSEKEY_INTERVAL` setting. The shorter the interval is set the smoother the movement will be. Setting the value too low makes the cursor unresponsive. Lower settings are possible if the micro processor is fast enough. For example: At an interval of `8` milliseconds, `125` movements per second will be initiated. With a base speed of `1000` each movement will move the cursor by `8` pixels.
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `2`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `1`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
### Constant mode

View File

@ -1,188 +1,112 @@
# Dactyl Manuform (4x5, 5x6, 5x7, 6x6, 6x7)
# Dactyl ManuForm
the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link.
![Imgur](https://i.imgur.com/7y0Vbyd.jpg)
![Imgur](https://i.imgur.com/7y0Vbydh.jpg)
*Pair of Dactyl Manuform 4x6*
## First Time Setup
Forked from the [Dactyl](/keyboards/handwired/dactyl), the *Dactyl ManuForm* is a parameterized, handwired, split bodied, tented, concave key-well design that incorporates the thumb cluster from the [ManuForm](https://geekhack.org/index.php?topic=46015.0).
Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using:
* Keyboard Maintainer: [Tom Short](https://github.com/tshort)
* Hardware Supported: Pro Micro, or clone of
* Hardware Availability: [Github](https://github.com/tshort/dactyl-keyboard)
Depending on your Layout chose one of the follwing commands:
## Variants
```
$ make handwired/dactyl_manuform/YOUR_LAYOUT:YOUR_KEYMAP_NAME
```
*Dactyl ManuForm's* are built in variations that cater for different row and column counts, and thumb clusters.
example:
As standard:
- The finger keywell bottom row has 2 keys, 1 each in ring and middle columns
- Exception to this rule is the `5x7` variant - that has two additional keys, per half, in this row
- The thumb cluster has 6 keys, arranged in a staggered 2 columns by 3 rows
```
$ make handwired/dactyl_manuform/4x5:default
```
Variants are denoted as `RowCount`*x*`ColumnCount`*(_`Alteration`)*
If everything worked correctly you will see a file:
### Row
| Count | Description |
| :---: | :---: |
| 4 | Three rows, typically for alphabet and some puncuation characters, with 2 key (finger keywell) bottom row |
| 5 | As *4 row* with number row above |
| 6 | As *5 row* with function row above |
```
dactyl_manuform_YOUR_LAYOUT_YOUR_KEYMAP_NAME.hex
```
### Column
| Count | Description |
| :---: | :---: |
| 5 | A column for each finger with additional column for first finger |
| 6 | As *5 column* with additional pinky finger column |
| 7 | As *6 column* with either an additional first finger column (`5x7`) or additional pinky column (`6x7`) |
For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md.
### Alteration
| Code | Description |
| :---: | :---: |
| 5 | Thumb cluster replaced with five key thumb cluster of [Dactyl Manuform Mini](https://github.com/l4u/dactyl-manuform-mini-keyboard) |
| 2_5 | Same as code *5* with two additional keys added to finger key-well bottom row |
## Case Files Generator
[Dactyl Generator](https://ryanis.cool/dactyl), created by [rianadon](https://github.com/rianadon), is a web based file generator that negates having to compose case files using programming languages, which was the matter when using the original *Dactyl* and *Dactyl ManuForm* GitHub repos, by instead compiling case files based on options and parameters configured in a web front end.
## Compile
Make example for this keyboard (after setting up your build environment) in the 5x6 variant:
make handwired/dactyl_manuform/5x6:default
Flashing example for this keyboard:
make handwired/dactyl_manuform/5x6:default:flash
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
## Keymaps
### [Keymaps 4x5](/keyboards/handwired/dactyl_manuform/4x5/keymaps/)
### Default
#### Default
The default functional layout, based on QWERTY, and every variant has this keymap; used as a starting point/template for custom keymaps and for debugging purposes when soldering key matrix to controller.
Simple QWERTY layout with 3 Layers.
### VIA
Similar to *Default* but adds support for the [VIA](https://usevia.app/) keymap configurator. Layer count set to 4 to comply with VIA defaults, and remaps keys to accommodate this constraint, if applicable.
#### Dvorak
Variants with VIA support:
- 4x6
- 5x6_5
- 5x7
### [Keymaps 5x6](/keyboards/handwired/dactyl_manuform/5x6/keymaps/)
### Miryoku
#### Default
For more information on this layout schematic, please see the [Miryoku Reference Manual](https://github.com/manna-harbour/miryoku/tree/master/docs/reference).
For QMK specifics, please see [Miryoku QMK](https://github.com/manna-harbour/miryoku_qmk/tree/miryoku/users/manna-harbour_miryoku).
Just a copy of the Impstyle keymap. Feel free to adjust it.
Variants with *Miryoku* support:
- 4x5
- 4x5_5
- 4x6
- 4x6_5
- 5x6
#### Impstyle
## Non-Pro Micro Controller Compilation
A simple QWERTY keymap with 3 Layers. Both sides are connected via serial and the Left ist the master.
### [Keymaps 5x6_5](/keyboards/handwired/dactyl_manuform/5x6_5/keymaps/)
Similar layout to 5x6 but with only 5 thumb keys per side instead of 6.
#### Default
QWERTY layout with 7 Layers.
#### Via
Similar to Default but adds support for the [Via](https://www.caniusevia.com/) keymap configurator. Reduces the number of layers to 4 to comply with Via defaults, and remaps
some keys to accomodate that constraint.
### [Keymaps 5x7 aka almost Ergodox](/keyboards/handwired/dactyl_manuform/5x7/keymaps/)
#### Default
Keymap of Loligagger from geekhack.
### [Keymaps 6x6](/keyboards/handwired/dactyl_manuform/6x6/keymaps/)
#### Default
Simple QWERTY layout with 3 Layers.
### [Keymaps 6x7](/keyboards/handwired/dactyl_manuform/6x7/keymaps/)
#### Default
Simple QWERTY layout with 3 Layers.
### [Keymaps 3x5_3](/keyboards/handwired/dactyl_manuform/3x5_3/keymaps/)
#### Dlford
QWERTY/Colemak layout with per key RGB and other features
## Required Hardware
Apart from diodes and key switches for the keyboard matrix in each half, you
will need:
- 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each.
- 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable
Alternatively, you can use any sort of cable and socket that has at least 3
wires. If you want to use I2C to communicate between halves, you will need a
cable with at least 4 wires and 2x 4.7kΩ pull-up resistors
## Optional Hardware
A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`.
## Wiring
The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e.
PD0 on the ATmega32u4) between the two Pro Micros.
Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro
and modify the `matrix.c` accordingly.
The wiring for serial:
![serial wiring](https://i.imgur.com/C3D1GAQ.png)
The wiring for i2c:
![i2c wiring](https://i.imgur.com/Hbzhc6E.png)
The pull-up resistors may be placed on either half. It is also possible
to use 4 resistors and have the pull-ups in both halves, but this is
unnecessary in simple use cases.
You can change your configuration between serial and i2c by modifying your `config.h` file.
## Notes on Software Configuration
the keymaps in here are for the 4x5 layout of the keyboard only.
If building a Dactyl Manuform with controllers that aren't a pro micro, the Converter feature of QMK will allow compilation of firmware for the intended variant and supported controller without having to create a new QMK keyboard/keymap.
Please see [Converters](https://docs.qmk.fm/#/feature_converters?id=supported-converters) documentation for list of controllers that are supported converting from `pro_micro` and how to implement conversion.
## Flashing
To flash your firmware take a look at: [Flashing Instructions and Bootloader Information](https://docs.qmk.fm/#/flashing)
To flash your board with generated firmware file, please see [Flashing Instructions and Bootloader Information](https://docs.qmk.fm/#/flashing)
## Choosing which board to plug the USB cable into (choosing Master)
## Handedness configurations
Because the two boards are identical, the firmware has logic to differentiate the left and right board.
See [Handedness](https://docs.qmk.fm/#/config_options?id=setting-handedness) documentation for more information on configuring handedness/master half.
It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable.
The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side.
The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra.
### Setting the left hand as master
If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set.
### Setting the right hand as master
If you always plug the usb cable into the right board, add an extra flag to your `config.h`
## VIA Configuration
Variants with a `via` keymap are VIA capable.
Compile firmware, for [enabled variant](#via), with it's `via` keymap and flash board with this firmware file.
```
#define MASTER_RIGHT
qmk compile -kb handwired/dactyl_manuform/4x6 -km via
```
### Setting EE_hands to use either hands as master
## Bootloader
If you define `EE_HANDS` in your `config.h`, you will need to set the
EEPROM for the left and right halves.
Enter the bootloader in 3 ways:
The EEPROM is used to store whether the
half is left handed or right handed. This makes it so that the same firmware
file will run on both hands instead of having to flash left and right handed
versions of the firmware to each half. To flash the EEPROM file for the left
half run:
```
make handwired/dactyl_promicro:default:dfu-split-left
make handwired/dactyl_promicro:default:dfu-split-right
```
After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash.
Note that you need to program both halves, but you have the option of using
different keymaps for each half. You could program the left half with a QWERTY
layout and the right half with a Colemak layout using bootmagic's default layout option.
Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the
right half is connected.
## Notes on Using Pro Micro 3.3V
Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects
the frequency on the 3.3V board.
Also, if the slave board is producing weird characters in certain columns,
update the following line in `matrix.c` to the following:
```
// wait_us(30); // without this wait read unstable value.
wait_us(300); // without this wait read unstable value.
```
* **Bootmagic reset**: If enabled, hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB or controller - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available

View File

@ -175,7 +175,7 @@ static uint8_t wheel_unit(void) {
/*
* Kinetic movement acceleration algorithm
*
* current speed = I + A * T/50 + A * 0.5 * T^2 | maximum B
* current speed = I + A * T/50 + A * (T/50)^2 * 1/2 | maximum B
*
* T: time since the mouse movement started
* E: mouse events per second (set through MOUSEKEY_INTERVAL, UHK sends 250, the
@ -192,37 +192,46 @@ const uint16_t mk_initial_speed = MOUSEKEY_INITIAL_SPEED;
static uint8_t move_unit(void) {
uint16_t speed = mk_initial_speed;
if (mousekey_accel & ((1 << 0) | (1 << 2))) {
speed = mousekey_accel & (1 << 2) ? mk_accelerated_speed : mk_decelerated_speed;
if (mousekey_accel & (1 << 0)) {
speed = mk_decelerated_speed;
} else if (mousekey_accel & (1 << 2)) {
speed = mk_accelerated_speed;
} else if (mousekey_repeat && mouse_timer) {
const uint16_t time_elapsed = timer_elapsed(mouse_timer) / 50;
speed = mk_initial_speed + MOUSEKEY_MOVE_DELTA * time_elapsed + MOUSEKEY_MOVE_DELTA * 0.5 * time_elapsed * time_elapsed;
speed = speed > mk_base_speed ? mk_base_speed : speed;
speed = mk_initial_speed + MOUSEKEY_MOVE_DELTA * time_elapsed + (MOUSEKEY_MOVE_DELTA * time_elapsed * time_elapsed) / 2;
if (speed > mk_base_speed) {
speed = mk_base_speed;
}
}
/* convert speed to USB mouse speed 1 to 127 */
speed = (uint8_t)(speed / (1000U / mk_interval));
speed = speed < 1 ? 1 : speed;
return speed > MOUSEKEY_MOVE_MAX ? MOUSEKEY_MOVE_MAX : speed;
if (speed > MOUSEKEY_MOVE_MAX) {
speed = MOUSEKEY_MOVE_MAX;
} else if (speed < 1) {
speed = 1;
}
return speed;
}
static uint8_t wheel_unit(void) {
uint16_t speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS;
if (mousekey_accel & ((1 << 0) | (1 << 2))) {
speed = mousekey_accel & (1 << 2) ? MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS : MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS;
if (mousekey_accel & (1 << 0)) {
speed = MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS;
} else if (mousekey_accel & (1 << 2)) {
speed = MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS;
} else if (mousekey_wheel_repeat && mouse_timer) {
if (mk_wheel_interval != MOUSEKEY_WHEEL_BASE_MOVEMENTS) {
const uint16_t time_elapsed = timer_elapsed(mouse_timer) / 50;
speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS + 1 * time_elapsed + 1 * 0.5 * time_elapsed * time_elapsed;
speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS + 1 * time_elapsed + (1 * time_elapsed * time_elapsed) / 2;
}
if (speed > MOUSEKEY_WHEEL_BASE_MOVEMENTS) {
speed = MOUSEKEY_WHEEL_BASE_MOVEMENTS;
}
speed = speed > MOUSEKEY_WHEEL_BASE_MOVEMENTS ? MOUSEKEY_WHEEL_BASE_MOVEMENTS : speed;
}
mk_wheel_interval = 1000U / speed;
return (uint8_t)speed > MOUSEKEY_WHEEL_INITIAL_MOVEMENTS ? 2 : 1;
return 1;
}
# endif /* #ifndef MK_KINETIC_SPEED */

View File

@ -31,7 +31,7 @@
#include "eeprom.h"
#include "version.h" // for QMK_BUILDDATE used in EEPROM magic
#if defined(RGB_MATRIX_ENABLE)
#if (defined(RGB_MATRIX_ENABLE) || defined(LED_MATRIX_ENABLE))
# include <lib/lib8tion/lib8tion.h>
#endif
@ -141,6 +141,9 @@ __attribute__((weak)) void via_set_device_indication(uint8_t value) {
#if defined(RGB_MATRIX_ENABLE)
rgb_matrix_toggle_noeeprom();
#endif // RGB_MATRIX_ENABLE
#if defined(LED_MATRIX_ENABLE)
led_matrix_toggle_noeeprom();
#endif // LED_MATRIX_ENABLE
#if defined(AUDIO_ENABLE)
if (value == 0) {
wait_ms(10);
@ -194,6 +197,7 @@ __attribute__((weak)) void via_custom_value_command_kb(uint8_t *data, uint8_t le
// id_qmk_backlight_channel -> via_qmk_backlight_command()
// id_qmk_rgblight_channel -> via_qmk_rgblight_command()
// id_qmk_rgb_matrix_channel -> via_qmk_rgb_matrix_command()
// id_qmk_led_matrix_channel -> via_qmk_led_matrix_command()
// id_qmk_audio_channel -> via_qmk_audio_command()
//
__attribute__((weak)) void via_custom_value_command(uint8_t *data, uint8_t length) {
@ -219,7 +223,14 @@ __attribute__((weak)) void via_custom_value_command(uint8_t *data, uint8_t lengt
via_qmk_rgb_matrix_command(data, length);
return;
}
#endif // RGBLIGHT_ENABLE
#endif // RGB_MATRIX_ENABLE
#if defined(LED_MATRIX_ENABLE)
if (*channel_id == id_qmk_led_matrix_channel) {
via_qmk_led_matrix_command(data, length);
return;
}
#endif // LED_MATRIX_ENABLE
#if defined(AUDIO_ENABLE)
if (*channel_id == id_qmk_audio_channel) {
@ -692,6 +703,90 @@ void via_qmk_rgb_matrix_save(void) {
#endif // RGB_MATRIX_ENABLE
#if defined(LED_MATRIX_ENABLE)
# if !defined(LED_MATRIX_MAXIMUM_BRIGHTNESS) || LED_MATRIX_MAXIMUM_BRIGHTNESS > UINT8_MAX
# undef LED_MATRIX_MAXIMUM_BRIGHTNESS
# define LED_MATRIX_MAXIMUM_BRIGHTNESS UINT8_MAX
# endif
void via_qmk_led_matrix_command(uint8_t *data, uint8_t length) {
// data = [ command_id, channel_id, value_id, value_data ]
uint8_t *command_id = &(data[0]);
uint8_t *value_id_and_data = &(data[2]);
switch (*command_id) {
case id_custom_set_value: {
via_qmk_led_matrix_set_value(value_id_and_data);
break;
}
case id_custom_get_value: {
via_qmk_led_matrix_get_value(value_id_and_data);
break;
}
case id_custom_save: {
via_qmk_led_matrix_save();
break;
}
default: {
*command_id = id_unhandled;
break;
}
}
}
void via_qmk_led_matrix_get_value(uint8_t *data) {
// data = [ value_id, value_data ]
uint8_t *value_id = &(data[0]);
uint8_t *value_data = &(data[1]);
switch (*value_id) {
case id_qmk_led_matrix_brightness: {
value_data[0] = ((uint16_t)led_matrix_get_val() * UINT8_MAX) / LED_MATRIX_MAXIMUM_BRIGHTNESS;
break;
}
case id_qmk_led_matrix_effect: {
value_data[0] = led_matrix_is_enabled() ? led_matrix_get_mode() : 0;
break;
}
case id_qmk_led_matrix_effect_speed: {
value_data[0] = led_matrix_get_speed();
break;
}
}
}
void via_qmk_led_matrix_set_value(uint8_t *data) {
// data = [ value_id, value_data ]
uint8_t *value_id = &(data[0]);
uint8_t *value_data = &(data[1]);
switch (*value_id) {
case id_qmk_led_matrix_brightness: {
led_matrix_set_val_noeeprom(scale8(value_data[0], LED_MATRIX_MAXIMUM_BRIGHTNESS));
break;
}
case id_qmk_led_matrix_effect: {
if (value_data[0] == 0) {
led_matrix_disable_noeeprom();
} else {
led_matrix_enable_noeeprom();
led_matrix_mode_noeeprom(value_data[0]);
}
break;
}
case id_qmk_led_matrix_effect_speed: {
led_matrix_set_speed_noeeprom(value_data[0]);
break;
}
}
}
void via_qmk_led_matrix_save(void) {
eeconfig_update_led_matrix();
}
#endif // LED_MATRIX_ENABLE
#if defined(AUDIO_ENABLE)
extern audio_config_t audio_config;

View File

@ -109,6 +109,7 @@ enum via_channel_id {
id_qmk_rgblight_channel = 2,
id_qmk_rgb_matrix_channel = 3,
id_qmk_audio_channel = 4,
id_qmk_led_matrix_channel = 5,
};
enum via_qmk_backlight_value {
@ -130,6 +131,12 @@ enum via_qmk_rgb_matrix_value {
id_qmk_rgb_matrix_color = 4,
};
enum via_qmk_led_matrix_value {
id_qmk_led_matrix_brightness = 1,
id_qmk_led_matrix_effect = 2,
id_qmk_led_matrix_effect_speed = 3,
};
enum via_qmk_audio_value {
id_qmk_audio_enable = 1,
id_qmk_audio_clicky_enable = 2,
@ -182,6 +189,13 @@ void via_qmk_rgb_matrix_get_value(uint8_t *data);
void via_qmk_rgb_matrix_save(void);
#endif
#if defined(LED_MATRIX_ENABLE)
void via_qmk_led_matrix_command(uint8_t *data, uint8_t length);
void via_qmk_led_matrix_set_value(uint8_t *data);
void via_qmk_led_matrix_get_value(uint8_t *data);
void via_qmk_led_matrix_save(void);
#endif
#if defined(AUDIO_ENABLE)
void via_qmk_audio_command(uint8_t *data, uint8_t length);
void via_qmk_audio_set_value(uint8_t *data);