Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ab0c2eb72 | ||
|
|
2e73bb9ea1 | ||
|
|
e5ac605b4c | ||
|
|
fb220038b7 | ||
|
|
464c56f599 |
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is loosely based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to the [UHK Versioning](VERSIONING.md) conventions.
|
||||
|
||||
## [8.5.4] - 2018-01-05
|
||||
|
||||
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||
|
||||
- Make the modifiers of shortcut keys stick only as long as the layer switcher key of a shortcut key is being held.
|
||||
|
||||
## [8.5.3] - 2018-10-20
|
||||
|
||||
Device Protocol: 4.5.0 | Module Protocol: 4.0.0 | User Config: 4.1.0 | Hardware Config: 1.0.0
|
||||
|
||||
@@ -25,3 +25,10 @@ Going forward, it's easier to flash the firmware of your choice by using the dow
|
||||
## Contributing
|
||||
|
||||
Want to contribute? Let us show you [how](/CONTRIBUTING.md).
|
||||
|
||||
## Custom Firmwares
|
||||
|
||||
The following list contains unofficial forks of the firmware. These forks provide functionality unavailable in the official firmware, but come without guarantees of any kind:
|
||||
|
||||
- [https://github.com/kareltucek/firmware](https://github.com/kareltucek/firmware) - firmware featuring macro engine extended by a set of custom commands, allowing more advanced configurations including custom layer switching logic, doubletap bindings, alternative secondary roles etc.
|
||||
|
||||
|
||||
Submodule lib/agent updated: a4e3696078...1eb8720305
@@ -13,7 +13,6 @@
|
||||
uint8_t timestamp;
|
||||
bool previous : 1;
|
||||
bool current : 1;
|
||||
bool suppressed : 1;
|
||||
bool debouncing : 1;
|
||||
} key_state_t;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ void updateLayerStates(void)
|
||||
for (uint8_t slotId=0; slotId<SLOT_COUNT; slotId++) {
|
||||
for (uint8_t keyId=0; keyId<MAX_KEY_COUNT_PER_MODULE; keyId++) {
|
||||
key_state_t *keyState = &KeyStates[slotId][keyId];
|
||||
if (keyState->current && !keyState->suppressed) {
|
||||
if (keyState->current) {
|
||||
key_action_t action = CurrentKeymap[LayerId_Base][slotId][keyId];
|
||||
if (action.type == KeyActionType_SwitchLayer) {
|
||||
if (action.switchLayer.mode != SwitchLayerMode_Toggle) {
|
||||
@@ -70,3 +70,14 @@ layer_id_t GetActiveLayer()
|
||||
|
||||
return heldLayer;
|
||||
}
|
||||
|
||||
bool IsLayerHeld(void)
|
||||
{
|
||||
for (layer_id_t layerId = LayerId_Mod; layerId <= LayerId_Mouse; layerId++) {
|
||||
if (heldLayers[layerId]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
// Functions:
|
||||
|
||||
layer_id_t GetActiveLayer();
|
||||
layer_id_t GetActiveLayer(void);
|
||||
bool IsLayerHeld(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -237,18 +237,15 @@ static void handleSwitchLayerAction(key_state_t *keyState, key_action_t *action)
|
||||
static uint8_t basicScancodeIndex = 0;
|
||||
static uint8_t mediaScancodeIndex = 0;
|
||||
static uint8_t systemScancodeIndex = 0;
|
||||
static uint8_t stickyModifiers;
|
||||
static uint8_t stickyModifiers, stickySlotId, stickyKeyId;
|
||||
static uint8_t secondaryRoleState = SecondaryRoleState_Released;
|
||||
static uint8_t secondaryRoleSlotId;
|
||||
static uint8_t secondaryRoleKeyId;
|
||||
static secondary_role_t secondaryRole;
|
||||
|
||||
static void applyKeyAction(key_state_t *keyState, key_action_t *action)
|
||||
static void applyKeyAction(key_state_t *keyState, key_action_t *action, uint8_t slotId, uint8_t keyId)
|
||||
{
|
||||
if (keyState->suppressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (keyState->current) {
|
||||
handleSwitchLayerAction(keyState, action);
|
||||
|
||||
switch (action->type) {
|
||||
@@ -256,6 +253,8 @@ static void applyKeyAction(key_state_t *keyState, key_action_t *action)
|
||||
if (action->keystroke.scancode) {
|
||||
if (!keyState->previous) {
|
||||
stickyModifiers = action->keystroke.modifiers;
|
||||
stickySlotId = slotId;
|
||||
stickyKeyId = keyId;
|
||||
}
|
||||
} else {
|
||||
ActiveUsbBasicKeyboardReport->modifiers |= action->keystroke.modifiers;
|
||||
@@ -304,6 +303,19 @@ static void applyKeyAction(key_state_t *keyState, key_action_t *action)
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
switch (action->type) {
|
||||
case KeyActionType_Keystroke:
|
||||
if (keyState->previous) {
|
||||
if (slotId == stickySlotId && keyId == stickyKeyId) {
|
||||
if (!IsLayerHeld() && !(secondaryRoleState == SecondaryRoleState_Triggered && IS_SECONDARY_ROLE_LAYER_SWITCHER(secondaryRole))) {
|
||||
stickyModifiers = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void updateActiveUsbReports(void)
|
||||
@@ -394,22 +406,22 @@ static void updateActiveUsbReports(void)
|
||||
secondaryRoleSlotId = slotId;
|
||||
secondaryRoleKeyId = keyId;
|
||||
secondaryRole = action->keystroke.secondaryRole;
|
||||
keyState->suppressed = true;
|
||||
}
|
||||
} else {
|
||||
applyKeyAction(keyState, action);
|
||||
applyKeyAction(keyState, action, slotId, keyId);
|
||||
}
|
||||
} else {
|
||||
keyState->suppressed = false;
|
||||
|
||||
// Release secondary role key.
|
||||
if (keyState->previous && secondaryRoleSlotId == slotId && secondaryRoleKeyId == keyId) {
|
||||
if (keyState->previous && secondaryRoleSlotId == slotId && secondaryRoleKeyId == keyId && secondaryRoleState != SecondaryRoleState_Released) {
|
||||
// Trigger primary role.
|
||||
if (secondaryRoleState == SecondaryRoleState_Pressed) {
|
||||
keyState->previous = false;
|
||||
applyKeyAction(keyState, action);
|
||||
keyState->current = true;
|
||||
applyKeyAction(keyState, action, slotId, keyId);
|
||||
}
|
||||
secondaryRoleState = SecondaryRoleState_Released;
|
||||
} else {
|
||||
applyKeyAction(keyState, action, slotId, keyId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"commander": "^2.11.0",
|
||||
"shelljs": "^0.7.8"
|
||||
},
|
||||
"firmwareVersion": "8.5.3",
|
||||
"firmwareVersion": "8.5.4",
|
||||
"deviceProtocolVersion": "4.5.0",
|
||||
"moduleProtocolVersion": "4.0.0",
|
||||
"userConfigVersion": "4.1.0",
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define FIRMWARE_MAJOR_VERSION 8
|
||||
#define FIRMWARE_MINOR_VERSION 5
|
||||
#define FIRMWARE_PATCH_VERSION 3
|
||||
#define FIRMWARE_PATCH_VERSION 4
|
||||
|
||||
#define DEVICE_PROTOCOL_MAJOR_VERSION 4
|
||||
#define DEVICE_PROTOCOL_MINOR_VERSION 5
|
||||
|
||||
Reference in New Issue
Block a user