aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input/keyboard.c
Commit message (Collapse)AuthorAge
* Make raw keysyms take precedence over translatedLibravatar Ben Challenor2019-03-10
| | | | | Allows both BackSpace and Shift+BackSpace to be bound under the US keyboard layout, per #3705.
* input/keyboard: respect solo repeat_{rate,delay}Libravatar Brian Ashworth2019-02-11
| | | | | | If `repeat_rate` or `repeat_delay` is set without the other being set, the default was being used for both. This changes the logic to respect the value given and use the default for the other when only one is set.
* bar_cmd_modifier: add support for noneLibravatar Brian Ashworth2019-02-11
| | | | | | | | sway-bar(5) documents `modifier none`, which comes from i3. This implements the functionality for `modifier none` since it was not previously implemented. The bar modifier toggles visibility of the bar when the bar mode is set to hide. When the bar modifier is set to `none`, the ability to toggle visibility of the bar will be disabled.
* Move sway-specific functions in common/util.c into sway/Libravatar M Stoeckl2019-01-21
| | | | | | Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
* Replace wlr_log with sway_logLibravatar M Stoeckl2019-01-21
| | | | | | | | | | | | | This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
* Disarm key repeat on reloadLibravatar Brian Ashworth2019-01-14
| | | | | | When resetting the keyboard during reload, disarm the key repeat on all keyboards since the bindings (and possibly keyboard) will be freed before the key repeat can go off.
* keyboard: update repeat timer before executionLibravatar Brian Ashworth2019-01-09
| | | | | | Since the keyboard can be destroyed by executing a binding (reloading with a different seat attachment config), update the repeat timer before executing the binding.
* binding: match single-key bindings if no multi-key binding matchedLibravatar Franklin "Snaipe" Mathieu2018-10-29
| | | | | | | This makes bindings more snappy when the user is typing faster than his keycaps are releasing. Signed-off-by: Franklin "Snaipe" Mathieu <me@snai.pe>
* Minor refactor of input managerLibravatar Ryan Dwyer2018-10-20
| | | | | | | | | | | | | | | | | | | | | The input manager is a singleton object. Passing the sway_input_manager argument to each of its functions is unnecessary, while removing the argument makes it obvious to the caller that it's a singleton. This patch removes the argument and makes the input manager use server.input instead. On a similar note: * sway_input_manager.server is removed in favour of using the server global. * seat.input is removed because it can get it from server.input. Due to a circular dependency, creating seat0 is now done directly in server_init rather than in input_manager_create. This is because creating seats must be done after server.input is set. Lastly, it now stores the default seat name using a constant and removes a second reference to seat0 (in input_manager_get_default_seat).
* cmd_bind{sym,code}: Implement per-device bindingsLibravatar Brian Ashworth2018-10-18
| | | | | bindsym --input-device=<identifier> ... bindcode --input-device=<identifier> ...
* swaybar: show hidden bar on key eventLibravatar Ian Fan2018-10-14
| | | | | | Since wayland does not currently allow swaybar to create global keybinds, this is handled within sway and sent to the bar using a custom event, so as not to pollute existing events, called bar_state_update.
* Remove unneeded variableLibravatar Ryan Dwyer2018-10-08
|
* Reload config using idle eventLibravatar Ryan Dwyer2018-10-08
| | | | | | | | | | | | | | | | This patch makes it so when you run reload, the actual reloading is deferred to the next time the event loop becomes idle. This avoids several use-after-frees and removes the workarounds we have to avoid them. When you run reload, we validate the config before creating the idle event. This is so the reload command will still return an error if there are validation errors. To allow this, load_main_config has been adjusted so it doesn't apply the config if validating is true rather than applying it unconditionally. This also fixes a memory leak in the reload command where if the config failed to load, the bar_ids list would not be freed.
* Fix #2763Libravatar Drew DeVault2018-10-04
|
* Fix management of bindings during reloadLibravatar Ryan Dwyer2018-09-06
| | | | | | | | | seat_execute_command needs to check the flags on `binding_copy`, as `binding` will be a dangling pointer after a reload command. handle_keyboard_key needs to set the next_repeat_binding for non-reloads prior to executing the command in case the binding is freed by the reload command.
* Deny repeating reload by holding keyLibravatar Ryan Dwyer2018-09-04
| | | | | | | | | | | | | | | Fixes #2568 The binding that gets stored in the keyboard's `repeat_binding` would get freed on reload, leaving a dangling pointer. Rather than attempt to unset the keyboard's `repeat_binding` along with the other bindings, I opted to just not set it for the reload command because there's no point in reloading repeatedly by holding the binding. This disables repeat bindings for the reload command. As we now need to detect whether it's a reload command in two places, I've added a binding flag to track whether it's a reload or not.
* Bindings use advised keyboard repeat parametersLibravatar frsfnrrg2018-07-29
| | | | | | | | | Now 'repeat_delay' and 'repeat_rate' control the initial delay and rate (per second) of repeated binding invocations. If the repeat delay is zero, binding repetition is disabled. When the repeat rate is zero, the binding is repeated exactly once, assuming no other key events intervene.
* Implement key repeat for pressed key bindingsLibravatar frsfnrrg2018-07-29
| | | | | | | | Each sway_keyboard is provided with a wayland timer event source. When a valid keypress binding has been found, a callback to handle_keyboard_repeat is set. Any key event will either clear the callback or (if the new key event is a valid keypress binding) delay the callback again.
* Don't enable numlock by default. This fixes an annoying issue where laptop ↵Libravatar Geoff Greer2018-07-28
| | | | keyboards would have 'numlock mode' enabled, remapping parts of the alphabet to numbers.
* Fix LEDs for configured modifier statesLibravatar ProgAndy2018-07-25
|
* Implement setting NumLock and CapsLock statusLibravatar ProgAndy2018-07-25
| | | | | | After setting the keymap, try to enable NumLock and disable CapsLock. This only works if sway has the xkb master state and controls the keyboard. Prepare configuration settings for later use as well.
* Invoke mouse bindingsLibravatar frsfnrrg2018-07-23
| | | | | | | | | | | | | | | | The mouse binding logic is inspired/copied from the keyboard binding logic; we store a sorted list of the currently pressed buttons, and trigger a binding when the currently pressed (or just recently pressed, in the case of a release binding) buttons, as well as modifiers/container region, match those of a given binding. As the code to execute a binding is not very keyboard specific, keyboard_execute_command is renamed to seat_execute_command and moved to where the other binding handling functions are. The call to transaction_commit_dirty has been lifted out.
* Parse mouse binding optionsLibravatar frsfnrrg2018-07-23
| | | | | | | | | | | | | | | | | | | | | | | | | | First, the existing sway_binding structure is given an enumerated type code. As all flags to bindsym/bindcode are boolean, a single uint32 is used to hold all flags. The _BORDER, _CONTENTS, _TITLEBAR flags, when active, indicate in which part of a container the binding can trigger; to localize complexity, they do not overlap with the command line arguments, which center around _TITLEBAR being set by default. The keyboard handling code is adjusted for this change, as is binding_key_compare; note that BINDING_LOCKED is *not* part of the key portion of the binding. Next, list of mouse bindings is introduced and cleaned up. Finally, the binding command parsing code is extended to handle the case where bindsym is used to describe a mouse binding rather than a keysym binding; the difference between the two may be detected as late as when the first key/button is parsed, or as early as the first flag. As bindings can have multiple keycodes/keysyms/buttons, mixed keysym/button sequences are prohibited.
* Make focus part of transactionsLibravatar Ryan Dwyer2018-07-15
| | | | | | | | | | | | Rather than maintain copies of the entire focus stack, this PR transactionises the focus by introducing two new properties to the container state and using those when rendering. * `bool focused` means this container has actual focus. Only one container should have this equalling true in its current state. * `struct sway_container *focus_inactive_child` points to the immediate child that was most recently focused (eg. for tabbed and stacked containers).
* Update for swaywm/wlroots#1126Libravatar emersion2018-07-09
|
* keyboard: free xkb keymap on destroyLibravatar Dominique Martinet2018-07-05
|
* fix handling key modifiers if not pressed at firstLibravatar Armin Preiml2018-06-28
| | | | fixes #2169
* Fix keyboard shortcut handling inconsistenciesLibravatar frsfnrrg2018-06-12
| | | | | | | | | | | | | | | | | | * Ensure that modifier keys are identified even when the next key does not produce a keysym. This requires that modifier change tracking be done for each sway_shortcut_state. * Permit regular and --release shortcuts on the same key combination. Distinct bindings are identified for press and release cases; note that the release binding needs to be identified for both key press and key release events. * Maintain ascending sort order for the shortcut state list, and keep track of the number of pressed key ids, for simpler (and hence faster) searching of the list of key bindings. * Move binding duplicate detection into get_active_binding to avoid duplicating error messages.
* Make command block implementation genericLibravatar Brian Ashworth2018-06-02
|
* Style fix, redundant entry removal, fix extra keysym deleteLibravatar frsfnrrg2018-06-01
|
* Rename update_shortcut_model to update_shortcut_stateLibravatar frsfnrrg2018-06-01
|
* Rename check_shortcut_model to get_active_bindingLibravatar frsfnrrg2018-06-01
|
* Style fixed for keyboard.cLibravatar frsfnrrg2018-06-01
|
* Remove almost-always redundant loop in key handlingLibravatar frsfnrrg2018-06-01
|
* Rewrite shortcut handling code to avoid hardcoded valuesLibravatar frsfnrrg2018-06-01
| | | | | | | | | The same shortcut algorithm is now used for keycodes, raw keysyms, and translated keysyms. Pressed keysyms are now stored in association with the keycodes that generated them. Modifier keycodes (and associated keysyms) are identified retroactively by the subsequent change to the modifier flags.
* Implement bindsym/bindcode --lockedLibravatar frsfnrrg2018-05-27
| | | | | | | | | Adds the --locked flag to bindsym and bindcode commands. When a keyboard's associated seat has an exclusive client (i.e, a screenlocker), then bindings are only executed if they have the locked flag. When there is no such client, this restriction is lifted.
* Idle handling for dpms/lockscreen et alLibravatar Mattias Eriksson2018-05-13
| | | | | | | | | Swayidle handles idle events and allows for dpms and lockscreen handling. It also handles systemd sleep events, and can raise a lockscreen on sleep Fixes #541
* Make key repeat configurableLibravatar Ryan Dwyer2018-04-18
| | | | | | | | | | | This creates two input commands for configuring the repeat delay and rate. Example config: input "myidentifier" { repeat_delay 250 repeat_rate 25 }
* Merge branch 'wlroots' into seat-fixesLibravatar Tony Crisci2018-04-02
|\
| * Partially implement move commandLibravatar Drew DeVault2018-04-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Works: - move [container|window] to workspace <name> - Note, this should be able to move C_CONTAINER but this is untested - move [workspace] to output [left|right|up|down|<name>] Not implemented yet: - move [left|right|up|down] - move scratchpad - move position
* | dont copy input configLibravatar Tony Crisci2018-04-02
|/
* take seat param for handle_command and renameLibravatar Tony Crisci2018-02-24
|
* add kill commandLibravatar Tony Crisci2018-01-20
|
* update for new wlr-keyboard modifiersLibravatar Tony Crisci2018-01-17
|
* sway: change all sway_log to wlr_logLibravatar Dominique Martinet2018-01-05
|
* cleanup bindingsLibravatar Tony Crisci2018-01-04
|
* binding releaseLibravatar Tony Crisci2018-01-04
|
* fix nitpicksLibravatar Tony Crisci2017-12-29
|
* overwrite old bindingsLibravatar Tony Crisci2017-12-28
|
* fix keyboard_execute_bindcodeLibravatar Tony Crisci2017-12-28
|