summaryrefslogtreecommitdiff
path: root/src/gui/gui-key.c
AgeCommit message (Collapse)Author
2023-07-08core: display focus hashtable for debug even if no key is matchingSébastien Helleu
2023-07-03core: fix stylesSébastien Helleu
2023-07-03core: don't send key_pressed signal again for the same key pressTrygve Aaberge
If you press an incomplete key sequence, previously WeeChat would send the key_pressed signal again for the same keys on the next key. E.g. if you press escape and then 1, previously you would get the key_pressed signal with signal_data `\x01[` when you pressed escape, and then key_pressed with `\x01[` again when you pressed 1 (plus key_pressed with `1` for the 1 key). So two signals for the escape key, even though it was only pressed once. With this patch, you only get one signal for each key press. So one with `\x01[` when you press escape and then one with `1` when you press 1.
2023-07-03core: don't send key_combo_* signals for incomplete keysTrygve Aaberge
Version 4.0.0 (specifically commit 1f5c791c3) changed the key handling so key_combo_* signals were sent for each character in a sequence, rather than just when the sequence is finished. This broke parts of the vimode.py script. E.g. for the up arrow, 3.8 sends key_combo_default signal once with the signal_data `\x01[[A`, while 4.0.0 sends it three times with the signal_data `\x01[`, `\x01[[` and `\x01[[A`. With this patch, the previous behavior is brought back. There is one small change though. In 3.8 if you press escape one or two times it doesn't send key_combo_default, but if you press it three or more times it sends it for each escape press. With this patch, it's never sent for plain escape presses, only when the sequence is finished with some other key. This is intentional, as getting key_combo_default for escape presses doesn't make sense since it's not a finished combo, and the behavior of 3.8 where you got it after three or more key presses was most likely unintentional as it just happened because it didn't match any key bindings anymore (there are key bindings starting with one or two escape characters, but not more).
2023-06-26core: display actual key name and command with key Alt+kSébastien Helleu
Key Alt+K (upper K) is removed as well as commands `/input grab_raw_key` and `/input grab_raw_key_command`.
2023-05-04api: don't split on newline by default in functions `command` and ↵Sébastien Helleu
`command_options` when input_multiline is set to 0 The API functions `command` and `command_options` (when `split_newline` = 0, which is the default value) don't split on newline and then the first line is executed and the subsequent lines (after "\n") are ignored. There are no changes when the input has multiple lines filled by the user: the split is done and multiple commands are executed (for example if the user is pasting multiple commands to execute).
2023-03-31core: replace key `meta2-` by `meta-[` in commentsSébastien Helleu
2023-03-31core: fix key `meta-[O` (unfocus with xterm) (closes #1900)Sébastien Helleu
2023-03-31core: remove keys `meta-[I` and `meta-[G` for pgup/pgdn (issue #1900)Sébastien Helleu
It seems no terminal return such codes any more for pgup/pgdn, and `meta-[I` is conflicting with the xterm terminal "focus in" key code. The keys are also removed from config when converting old keys, but only if they are bound to the default command (`/window page_up` for `meta2-I` and `/window page_down` for `meta2-G`).
2023-03-25core: Include blank lines in paste line countTrygve Aaberge
Since pastes are now inserted into the input instead of sent, and blank lines are preserved in the input, they should now be counted too.
2023-03-25core: Remove option weechat.look.paste_auto_add_newlineTrygve Aaberge
This option existed so that you could edit the last line of a multiline paste before it was sent. Now that pasting multiple lines don't cause the lines to be sent immediately anymore, this option isn't useful anymore since you can always edit pasted text before it's sent.
2023-03-25core: Always remove final newline when pastingTrygve Aaberge
Since pasting doesn't send the line now, it's more practical to always remove the final newline so you don't end up with an empty line at the end of the input buffer. Fixes a part of #1498
2023-03-25core: Replace newline/tabs after paste is acceptedTrygve Aaberge
Instead of replacing newline/tabs when paste is started, do it when the paste is accepted instead. This makes a difference if you paste again while the paste confirmation is active, where instead of running it again for each paste, it will now be run for all the text at the end. For now this doesn't make a practical difference, but the next commit will remove the final newline when multiple lines are pasted too, which we only want to do for the final paste.
2023-03-25core: fix uninitialized variable `chunks2_count` when key_name and ↵Sébastien Helleu
key_name_alias are the same
2023-03-25core: remove unnecessary assignmentSébastien Helleu
2023-03-25core: remove commented codeSébastien Helleu
2023-03-18core: bump version to 4.0.0-dev, follow "practical" semantic versioningSébastien Helleu
2023-03-17core: also display mouse codes with `/debug key`Sébastien Helleu
2023-03-17core: change order of modifiers in mouse keysSébastien Helleu
Now the modifiers for mouse keys are in the same order as other keys: `alt-` then `ctrl-`.
2023-03-17core: fix search of commands with raw code and alias matchingSébastien Helleu
When raw code and alias for a key are both matching, the raw code must always have higher priority. This commit fixes this behavior and gives priority to raw code.
2023-03-17core: refactor print of keys in debug modeSébastien Helleu
Changes: - add function gui_key_debug_print_key - change message "no key" by "no key binding" - remove messages ""insert into input" / "ignored" - add color for delimiters
2023-03-17core: replace "\x01" by "^" and add color for delimiters in output of /debug keySébastien Helleu
2023-03-17core: use order returned by gui_key_expand in gui_key_modifier_listSébastien Helleu
2023-03-17core: display a warning when trying to bind a raw key code or invalid key ↵Sébastien Helleu
(missing comma)
2023-03-17core: check new keys manually added with /setSébastien Helleu
2023-03-17core: remove use of "meta2-" in key nameSébastien Helleu
The raw key code is kept as-is, so for example "meta2-A" becomes "meta-[A".
2023-03-16core: display a specific error when trying to bind a key without area in ↵Sébastien Helleu
mouse context
2023-03-16api: change also default value of new key options with function key_bindSébastien Helleu
2023-03-16core: split alias list into two listsSébastien Helleu
2023-03-16tests: add extra test on function gui_key_legacy_to_aliasSébastien Helleu
2023-03-16api: change default value of existing key options with function key_bindSébastien Helleu
With this fix, fset buffer shows the key as modified only if the user actually changed the command bound to the key.
2023-03-16core: create config options for all keys that can be managed with `/set` and ↵Sébastien Helleu
`/fset` commands
2023-03-16core: fix safe list of keysSébastien Helleu
Add missing safe keys: "backspace" and "return". Add missing unsafe keys: "comma", "space".
2023-03-16core: remove obsolete function gui_key_legacy_expandSébastien Helleu
2023-03-16core: optimize search of key by reducing the number of splits into chunksSébastien Helleu
2023-03-16core: add key alt-K (alt+shift+k) to grab raw key and its commandSébastien Helleu
2023-03-16core: use new key name in command `/key` and configuration fileSébastien Helleu
Legacy keys are automatically converted to new names when loading configuration file `weechat.conf`. Examples: "ctrl-I" => "tab" "meta2-1;3A" => "meta-up" "meta2-Z" => "shift-tab" "meta-wmeta-meta2-A" => "meta-w,meta-up" "ctrl-Cb" => "ctrl-c,b"
2023-03-16core: display new key name using aliases in output of `/key` commandSébastien Helleu
2023-03-16core: fix function gui_key_legacy_to_alias with keys on areasSébastien Helleu
2023-03-16core: add function to expand raw key code to name with alias, use it in /key ↵Sébastien Helleu
debug
2023-03-16core: add keyboard debug mode with command `/key debug`Sébastien Helleu
2023-02-04core: optimize search of key bindings in contexts default/search/cursorSébastien Helleu
2023-02-03core: simplify function gui_key_cmpSébastien Helleu
2023-01-29core: force ctrl keys to lower case when they are added (closes #1875)Sébastien Helleu
2023-01-29core: ignore incomplete ctrl/meta/meta2 codes in keys (issue #1875)Sébastien Helleu
2023-01-29core: compute first internal code and expanded name before removing key ↵Sébastien Helleu
(issue #1875)
2023-01-29core: compute first internal code and expanded name before adding key (issue ↵Sébastien Helleu
#1875)
2023-01-29core: use dynamic string in functions gui_key_get_internal_code and ↵Sébastien Helleu
gui_key_get_expanded_name (issue #1875)
2023-01-29tests: add tests on gui key functions (issue #1875)Sébastien Helleu
2023-01-28core, plugins: replace calls to strcmp by string_strcmp when difference ↵Sébastien Helleu
matters (issue #1872)