mirror of
https://github.com/swaywm/sway.git
synced 2024-11-25 09:21:28 +00:00
changes
This commit is contained in:
parent
1d9b73ed67
commit
ba6034e8c8
20
sway.5.txt
20
sway.5.txt
|
@ -22,11 +22,11 @@ Commands
|
|||
--------
|
||||
|
||||
**bindsym** <key combo> <command>::
|
||||
Binds _key combo_ to execute _command_ when pressed. You may use XKB key names
|
||||
here (**xev**(1) is a good tool for discovering them). An example bindsym
|
||||
command would be _bindsym Mod1+Shift+f exec firefox_, which would execute
|
||||
Firefox if the alt, shift, and F keys are pressed together. Any valid sway
|
||||
command is eligible to be bound to a key combo.
|
||||
Binds _key combo_ to execute _command_ when pressed. You may use XKB key
|
||||
names here (**xev**(1) is a good tool for discovering them). An example
|
||||
bindsym command would be _bindsym Mod1+Shift+f exec firefox_, which would
|
||||
execute Firefox if the alt, shift, and F keys are pressed together. Any
|
||||
valid sway command is eligible to be bound to a key combo.
|
||||
|
||||
**exec** <shell command>::
|
||||
Executes _shell command_ with sh.
|
||||
|
@ -41,9 +41,6 @@ Commands
|
|||
**floating** toggle::
|
||||
Toggles the "floating" status of the focused view.
|
||||
|
||||
**floating** mode_toggle::
|
||||
Toggles focus between floating view and tiled view.
|
||||
|
||||
**focus** <direction>::
|
||||
Direction may be one of _up_, _down_, _left_, _right_, or _parent_. The
|
||||
directional focus commands will move the focus in that direction. The parent
|
||||
|
@ -51,6 +48,9 @@ Commands
|
|||
container, which is useful, for example, to open a sibling of the parent
|
||||
container, or to move the entire container around.
|
||||
|
||||
**focus** mode_toggle::
|
||||
Toggles focus between floating view and tiled view.
|
||||
|
||||
**focus_follows_mouse** <yes|no>::
|
||||
If set to _yes_, the currently focused view will change as you move your
|
||||
mouse around the screen to the view that ends up underneath your mouse.
|
||||
|
@ -86,10 +86,10 @@ Commands
|
|||
**fullscreen**::
|
||||
Toggles fullscreen status for the focused view.
|
||||
|
||||
**gaps** <amount>**::
|
||||
**gaps** <amount>::
|
||||
Adds _amount_ pixels between each view, and around each output.
|
||||
|
||||
**gaps** <inner|outer> <amount>**::
|
||||
**gaps** <inner|outer> <amount>::
|
||||
Adds _amount_ pixels as an _inner_ or _outer_ gap, where the former affects
|
||||
spacing between views and the latter affects the space around each output.
|
||||
|
||||
|
|
|
@ -4,14 +4,13 @@
|
|||
|
||||
#include "input_state.h"
|
||||
|
||||
enum { KEY_STATE_MAX_LENGTH = 64 };
|
||||
#define KEY_STATE_MAX_LENGTH 64
|
||||
|
||||
static keycode key_state_array[KEY_STATE_MAX_LENGTH];
|
||||
static uint8_t key_state_length = 0;
|
||||
|
||||
static uint8_t find_key(keycode key) {
|
||||
int i;
|
||||
for (i = 0; i < key_state_length; ++i) {
|
||||
for (i = 0; i < KEY_STATE_MAX_LENGTH; ++i) {
|
||||
if (key_state_array[i] == key) {
|
||||
break;
|
||||
}
|
||||
|
@ -20,26 +19,25 @@ static uint8_t find_key(keycode key) {
|
|||
}
|
||||
|
||||
bool check_key(keycode key) {
|
||||
return find_key(key) < key_state_length;
|
||||
return find_key(key) < KEY_STATE_MAX_LENGTH;
|
||||
}
|
||||
|
||||
void press_key(keycode key) {
|
||||
// Check if key exists
|
||||
if (!check_key(key)) {
|
||||
// Check that we dont exceed buffer length
|
||||
if (key_state_length < KEY_STATE_MAX_LENGTH) {
|
||||
key_state_array[key_state_length++] = key;
|
||||
int insert = find_key(0);
|
||||
if (insert < KEY_STATE_MAX_LENGTH) {
|
||||
key_state_array[insert] = key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void release_key(keycode key) {
|
||||
uint8_t index = find_key(key);
|
||||
if (index < key_state_length) {
|
||||
if (index < KEY_STATE_MAX_LENGTH) {
|
||||
//shift it over and remove key
|
||||
memmove(&key_state_array[index],
|
||||
&key_state_array[index + 1],
|
||||
sizeof(*key_state_array) * (--key_state_length - index));
|
||||
key_state_array[index] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue