1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

core: add context "search" for keys (to define keys used during search in buffer with ctrl+"r")

This commit is contained in:
Sebastien Helleu
2011-07-05 15:36:42 +02:00
parent 5250b68d0a
commit 3bea55b2f0
52 changed files with 2667 additions and 1756 deletions
+3 -1
View File
@@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.6-dev, 2011-06-29
v0.3.6-dev, 2011-07-05
Version 0.3.6 (under dev!)
--------------------------
* core: add context "search" for keys (to define keys used during search in
buffer with ctrl+"r")
* core: add new option weechat.look.separator_vertical, rename option
weechat.look.hline_char to weechat.look.separator_horizontal
* core: fix freeze when hook_fd is called with a bad file/socket (bug #33619)
@@ -90,6 +90,8 @@
| weechat | keys_codes_for_reset | Tastenbelegungen die zurückgesetzt werden können (hinzugefügte/verändert/gelöschte Tastenbelegungen)
| weechat | keys_contexts | key contexts
| weechat | nicks | Nicks in Nickliste des aktuellen Buffers
| weechat | palette_colors | Farbpalette
+69 -56
View File
@@ -244,76 +244,89 @@ value: Anzahl der gewünschten Einträgen im Befehlsverlauf anzeigen
........................................
/input <action> [<arguments>]
Auflistung der Aktionen:
return: simuliert die "enter" Taste
complete_next: vervollständigt Word mit nächster Komplettierung
complete_previous: vervollständigt Word mit vorheriger Komplettierung
search_text: sucht nach Text im Buffer
delete_previous_char: entfernt vorheriges Zeichen
delete_next_char: entfernt nächstes Zeichen
delete_previous_word: entfernt vorheriges Wort
delete_next_word: entfernt nächstes Wort
delete_beginning_of_line: entfernt alle Zeichen ab Zeilenanfang bis zum Cursor
delete_end_of_line: entfernt alle Zeichen ab Cursor bis zum Ende der Zeile
delete_line: löscht die komplette Eingabezeile
clipboard_paste: fügt Zeichenkette aus der Zwischenablage ein
transpose_chars: Zeichen austauschen
undo: letzten Befehl in der Eingabezeile rückgängig machen
redo: letzten Befehl in der Eingabezeile wiederherstellen
move_beginning_of_line: springt an den Anfang der Eingabezeile
move_end_of_line: springt ans Ende der Eingabezeile
move_previous_char: setzt den Cursor eine Position nach links
move_next_char: setzt den Cursor eine Position nach rechts
move_previous_word: springt zum Anfang des vorherigen Wortes, in der Eingabezeile
move_next_word: springt zum Anfang des nächsten Wortes, in der Eingabezeile
history_previous: ruft vorherigen Befehl oder Nachricht aus dem Befehlsspeicher auf (im Such-Modus: rückwärts suchen)
history_next: ruft nächsten Befehl oder Nachricht aus dem Befehlsspeicher auf (im Such-Modus: vorwärts suchen)
history_global_previous: ruft vorherigen Befehl/Nachricht aus dem globalen Befehlsspeicher auf (für alle Buffer)
history_global_next: ruft nächsten Befehl/Nachricht aus dem globalen Befehlsspeicher auf (für alle Buffer)
jump_smart: wechselt zum nächsten Buffer mit Aktivität (nach Priorität: highlight, Nachricht, …)
jump_last_buffer: wechselt zum letzten Buffer
jump_previously_visited_buffer: springt zum letzten besuchten Buffer
jump_next_visited_buffer: springt zum nächsten besuchten Buffer
hotlist_clear: löscht Hotliste (Aktivitätsanzeige für die Buffer)
grab_key: fängt eine Taste
grab_key_command: zeigt den Tastencode (inklusive des eingebundenen Befehls) einer Tastenkombination an und fügt ihn in die Befehlszeile ein
scroll_unread: springe zur ersten ungelesenen Zeile im Buffer
set_unread: setzt die ungelesen Markierung für alle Buffer
set_unread_current_buffer: setzt die ungelesen Markierung für den aktuellen Buffer
switch_active_buffer: springt zum nächsten zusammengefügten Buffer
switch_active_buffer_previous: springt zum vorherigen zusammengefügten Buffer
insert: fügt einen Text in die Eingabezeile ein
list of actions:
return: simulate key "enter"
complete_next: complete word with next completion
complete_previous: complete word with previous completion
search_text: search text in buffer
search_switch_case: switch exact case for search
search_previous: search previous line
search_next: search next line
search_stop: stop search
delete_previous_char: delete previous char
delete_next_char: delete next char
delete_previous_word: delete previous word
delete_next_word: delete next word
delete_beginning_of_line: delete from beginning of line until cursor
delete_end_of_line: delete from cursor until end of line
delete_line: delete entire line
clipboard_paste: paste from clipboard
transpose_chars: transpose two chars
undo: undo last command line action
redo: redo last command line action
move_beginning_of_line: move cursor to beginning of line
move_end_of_line: move cursor to end of line
move_previous_char: move cursor to previous char
move_next_char: move cursor to next char
move_previous_word: move cursor to previous word
move_next_word: move cursor to next word
history_previous: recall previous command in current buffer history
history_next: recall next command in current buffer history
history_global_previous: recall previous command in global history
history_global_next: recall next command in global history
jump_smart: jump to next buffer with activity
jump_last_buffer: jump to last buffer
jump_previously_visited_buffer: jump to previously visited buffer
jump_next_visited_buffer: jump to next visited buffer
hotlist_clear: clear hotlist
grab_key: grab a key
grab_key_command: grab a key with its associated command
scroll_unread: scroll to unread marker
set_unread: set unread marker for all buffers
set_unread_current_buffer: set unread marker for current buffer
switch_active_buffer: switch to next merged buffer
switch_active_buffer_previous: switch to previous merged buffer
insert: insert text in command line
Dieser Befehl wird durch Tastenbelegungen oder Erweiterungen genutzt.
This command is used by key bindings or plugins.
........................................
[command]*`key`* Einer Taste einen Befehl zuordnen oder entfernen::
........................................
/key list|listdefault|listdiff
/key list|listdefault|listdiff [<context>]
bind <key> [<command> [<args>]]
bindctxt <context> <key> [<command> [<args>]]
unbind <key>
unbindctxt <context> <key>
reset <key>
resetall -yes
missing
resetctxt <context> <key>
resetall -yes [<context>]
missing [<context>]
list: zeigt die aktuelle Tastenbelegungen an (Standardaufruf)
listdefault: zeigt die Standardeinstellung der Tastenbelegung an
listdiff: zeigt die Unterschiede zwischen der aktuell genutzten Tastaturbelegung und der Standardbelegung an (hinzugefügte/verändert/gelöschte Tastenbelegungen)
bind: belegt eine Taste mit einem Befehl oder zeigt an welcher Befehl auf eine Taste gelegt wurde
unbind: hebt eine Tastenbelegung auf
reset: die Tastenbelegung wird für die ausgewählte Taste auf die Standardeinstellung zurück gesetzt
resetall: die Tastenbelegung wird auf die Standardeinstellungen zurück gesetzt. Dies löscht ALLE persönlichen Tastenbelegungen (Vorsicht!)
missing: fügt fehlende Tastenbelegungen hinzu (dazu wird die Standardbelegung genutzt). Dies kann sinnvoll sein wenn man auf eine neue WeeChat Version umgestiegen ist
list: list all current keys (without argument, this list is displayed)
listdefault: list default keys
listdiff: list differences between current and default keys (keys added, redefined or deleted)
context: name of context ("default" or "search")
bind: bind a command to a key or display command bound to key (for context "default")
bindctxt: bind a command to a key or display command bound to key, for given context
unbind: remove a key binding (for context "default")
unbindctxt: remove a key binding for given context
reset: reset a key to default binding (for context "default")
resetctxt: reset a key to default binding, for given context
resetall: restore bindings to the default values and delete ALL personal bindings (use carefully!)
missing: add missing keys (using default bindings), useful after installing new WeeChat version
Falls einer Taste ein Befehl zugeordnet werden soll ist es ratsam dies mittels alt+k (oder Esc und k) zu machen um dann die Taste auszuwählen, die belegt werden soll. Durch diesen Schritt wird der entsprechende Tasten-Code in die Befehlszeile übernommen.
When binding a command to a key, it is recommended to use key alt+k (or Esc then k), and then press the key to bind: this will insert key code in command line.
Beispiele:
Mit der Tastenkombination "alt-x" kann die Nicklist-Bar an-und aus geschaltet werden:
Examples:
key alt-x to toggle nicklist bar:
/key bind meta-x /bar toggle nicklist
Mit der Tastenkombination "alt-r" wird direkt zum IRC #weechat Buffer gewechselt:
key alt-r to jump to #weechat IRC channel:
/key bind meta-r /buffer #weechat
Die Tastenkombination "alt-r" wird auf die Standardfunktion zurückgesetzt:
restore default binding for key alt-r:
/key reset meta-r
key "tab" to stop search in buffer:
/key bindctxt search ctrl-I /input search_stop
........................................
[command]*`layout`* Layout für Buffer und Fenster speichern, anwenden oder zurücksetzen::
+21 -1
View File
@@ -435,7 +435,8 @@ Tastenbefehle für die Befehlszeile
| @k(Backsp.) .2+| entfernt in der Befehlszeile das vorherige Zeichen .2+| /input delete_previous_char
| @k(C-)@k(h)
| @k(C-)@k(k) | entfernt alle Zeichen vom Cursor bis zum Ende der Zeile (Zeichenkette wird in Zwischenablage kopiert) | /input delete_end_of_line
| @k(C-)@k(r) | Textsuche im Verlaufsspeicher des Buffers (zweimaliges Drücken: exakte Textsuche), @k(↑): vorheriges, @k(↓): nächstes, @k(Enter): beenden | /input search_text
// TRANSLATION MISSING
| @k(C-)@k(r) | Textsuche im Verlaufsspeicher des Buffers (see <<key_bindings_search_context,keys for search context>>) | /input search_text
| @k(C-)@k(t) | Zeichen austauschen | /input transpose_chars
| @k(C-)@k(u) | entfernt alle Zeichen vom Cursor bis zum Anfang der Zeile (Zeichenkette wird in Zwischenablage kopiert) | /input delete_beginning_of_line
| @k(C-)@k(w) | entfernt das Wort links vom Cursor (entferntes Wort wird in Zwischenablage kopiert) | /input delete_previous_word
@@ -508,6 +509,25 @@ Tastenbefehle für Buffer / Fenster
| @k(A-)@k(>) | springt zum nächsten besuchten Buffer | /input jump_next_visited_buffer
|========================================
// TRANSLATION MISSING
[[key_bindings_search_context]]
Keys for "search" context
^^^^^^^^^^^^^^^^^^^^^^^^^
These keys are used in context "search" (when @k(C-)@k(r) is pressed to search
text in buffer).
[width="100%",cols="^.^3,.^10,.^5m",options="header"]
|========================================
| Key | Description | Command
| @k(C-)@k(r) | Switch exact case for search | /input search_switch_case
| @k(↑) | Search previous line | /input search_previous
| @k(↓) | Search next line | /input search_next
| @k(Enter) .3+| Stop search .3+| /input search_stop
| @k(C-)@k(j)
| @k(C-)@k(m)
|========================================
[[key_bindings_other]]
andere Tastenbefehle
^^^^^^^^^^^^^^^^^^^^
@@ -90,6 +90,8 @@
| weechat | keys_codes_for_reset | key codes that can be reset (keys added, redefined or removed)
| weechat | keys_contexts | key contexts
| weechat | nicks | nicks in nicklist of current buffer
| weechat | palette_colors | palette colors
+19 -6
View File
@@ -249,6 +249,10 @@ list of actions:
complete_next: complete word with next completion
complete_previous: complete word with previous completion
search_text: search text in buffer
search_switch_case: switch exact case for search
search_previous: search previous line
search_next: search next line
search_stop: stop search
delete_previous_char: delete previous char
delete_next_char: delete next char
delete_previous_word: delete previous word
@@ -289,19 +293,26 @@ This command is used by key bindings or plugins.
[command]*`key`* bind/unbind keys::
........................................
/key list|listdefault|listdiff
/key list|listdefault|listdiff [<context>]
bind <key> [<command> [<args>]]
bindctxt <context> <key> [<command> [<args>]]
unbind <key>
unbindctxt <context> <key>
reset <key>
resetall -yes
missing
resetctxt <context> <key>
resetall -yes [<context>]
missing [<context>]
list: list all current keys (without argument, this list is displayed)
listdefault: list default keys
listdiff: list differences between current and default keys (keys added, redefined or deleted)
bind: bind a command to a key or display command bound to key
unbind: remove a key binding
reset: reset a key to default binding
context: name of context ("default" or "search")
bind: bind a command to a key or display command bound to key (for context "default")
bindctxt: bind a command to a key or display command bound to key, for given context
unbind: remove a key binding (for context "default")
unbindctxt: remove a key binding for given context
reset: reset a key to default binding (for context "default")
resetctxt: reset a key to default binding, for given context
resetall: restore bindings to the default values and delete ALL personal bindings (use carefully!)
missing: add missing keys (using default bindings), useful after installing new WeeChat version
@@ -314,6 +325,8 @@ Examples:
/key bind meta-r /buffer #weechat
restore default binding for key alt-r:
/key reset meta-r
key "tab" to stop search in buffer:
/key bindctxt search ctrl-I /input search_stop
........................................
[command]*`layout`* save/apply/reset layout for buffers and windows::
+19 -1
View File
@@ -437,7 +437,7 @@ Keys for command line
| @k(Backsp.) .2+| Delete previous char in command line .2+| /input delete_previous_char
| @k(C-)@k(h)
| @k(C-)@k(k) | Delete from cursor until end of command line (deleted string is copied to clipboard) | /input delete_end_of_line
| @k(C-)@k(r) | Search for text in buffer history (two times: search exact text), @k(↑): previous, @k(↓): next, @k(Enter): stop | /input search_text
| @k(C-)@k(r) | Search for text in buffer history (see <<key_bindings_search_context,keys for search context>>) | /input search_text
| @k(C-)@k(t) | Transpose chars | /input transpose_chars
| @k(C-)@k(u) | Delete from cursor until beginning of command line (deleted string is copied to clipboard) | /input delete_beginning_of_line
| @k(C-)@k(w) | Delete previous word of command line (deleted string is copied to clipboard) | /input delete_previous_word
@@ -510,6 +510,24 @@ Keys for buffers / windows
| @k(A-)@k(>) | Switch to next buffer in list of visited buffers | /input jump_next_visited_buffer
|========================================
[[key_bindings_search_context]]
Keys for "search" context
^^^^^^^^^^^^^^^^^^^^^^^^^
These keys are used in context "search" (when @k(C-)@k(r) is pressed to search
text in buffer).
[width="100%",cols="^.^3,.^10,.^5m",options="header"]
|========================================
| Key | Description | Command
| @k(C-)@k(r) | Switch exact case for search | /input search_switch_case
| @k(↑) | Search previous line | /input search_previous
| @k(↓) | Search next line | /input search_next
| @k(Enter) .3+| Stop search .3+| /input search_stop
| @k(C-)@k(j)
| @k(C-)@k(m)
|========================================
[[key_bindings_other]]
Other keys
^^^^^^^^^^
@@ -90,6 +90,8 @@
| weechat | keys_codes_for_reset | codes des touches pouvant être réinitialisées (touches ajoutées, redéfinies ou supprimées)
| weechat | keys_contexts | contextes de touches
| weechat | nicks | pseudos dans la liste des pseudos du tampon courant
| weechat | palette_colors | couleurs de la palette
+16 -3
View File
@@ -249,6 +249,10 @@ list des actions:
complete_next: compléter le mot avec la complétion suivante
complete_previous: compléter le mot avec la complétion précédente
search_text: chercher du texte dans le tampon
search_switch_case: basculer la casse exacte pour la recherche
search_previous: chercher la ligne précédente
search_next: chercher la ligne suivante
search_stop: arrêter la recherche
delete_previous_char: effacer le caractère précédent
delete_next_char: effacer le caractère suivant
delete_previous_word: effacer le mot précédent
@@ -289,19 +293,26 @@ Cette commande est utilisé par les associations de touches ou les extensions.
[command]*`key`* associer/libérer des touches::
........................................
/key list|listdefault|listdiff
/key list|listdefault|listdiff [<contexte>]
bind <touche> [<commande> [<args>]]
bindctxt <contexte> <touche> [<commande> [<args>]]
unbind <touche>
unbindctxt <contexte> <touche>
reset <touche>
resetall -yes
missing
resetctxt <contexte> <touche>
resetall -yes [<contexte>]
missing [<contexte>]
list: afficher toutes les touches courantes (sans paramètre, cette liste est affichée)
listdefault: afficher les touches par défaut
listdiff: afficher les différences entre les touches courantes et celles par défaut (touches ajoutées, redéfinies ou supprimées)
contexte: nom du contexte ("default" ou "search")
bind: associer une commande à une touche ou affiche la commande associée à la touche
bindctxt: associer une commande à une touche ou affiche la commande associée à la touche pour le contexte donné
unbind: supprimer l'association à une touche
unbindctxt: supprimer l'association à une touche pour le contexte donné
reset: réinitialiser une touche à son association par défaut
resetctxt: réinitialiser une touche à son association par défaut pour le contexte donné
resetall: restaurer les touches aux valeurs par défaut et supprimer TOUTES les touches personnelles (utiliser avec précaution !)
missing: ajouter les touches manquantes (en utilisant les touches par défaut), pratique après installation d'une nouvelle version de WeeChat
@@ -314,6 +325,8 @@ Exemples:
/key bind meta-r /buffer #weechat
restaure l'association par défaut pour la touche alt-r:
/key reset meta-r
touche "tab" pour arrêter la recherche dans le tampon:
/key bindctxt search ctrl-I /input search_stop
........................................
[command]*`layout`* sauver/appliquer/réinitialiser la disposition des tampons et fenêtres::
+20 -1
View File
@@ -445,7 +445,7 @@ Touches pour la ligne de commande
| @k(Backsp.) .2+| Effacer le caractère précédent sur la ligne de commande .2+| /input delete_previous_char
| @k(C-)@k(h)
| @k(C-)@k(k) | Effacer du curseur jusqu'à la fin de la ligne de commande (la chaîne supprimée est copiée dans le presse-papiers) | /input delete_end_of_line
| @k(C-)@k(r) | Chercher du texte dans l'historique du tampon (deux appuis successifs pour rechercher du texte exact), @k(↑): précédent, @k(↓): suivant, @k(Enter): arrêter | /input search_text
| @k(C-)@k(r) | Chercher du texte dans l'historique du tampon (voir <<key_bindings_search_context,les touches pour le contexte de recherche>>) | /input search_text
| @k(C-)@k(t) | Inverser deux caractères | /input transpose_chars
| @k(C-)@k(u) | Effacer du curseur jusqu'au début de la ligne de commande (la chaîne supprimée est copiée dans le presse-papiers) | /input delete_beginning_of_line
| @k(C-)@k(w) | Effacer le mot précédent sur la ligne de commande (la chaîne supprimée est copiée dans le presse-papiers) | /input delete_previous_word
@@ -518,6 +518,25 @@ Touches pour les tampons / fenêtres
| @k(A-)@k(>) | Sauter au tampon suivant dans la liste des tampons visités | /input jump_next_visited_buffer
|========================================
[[key_bindings_search_context]]
Keys for "search" context
^^^^^^^^^^^^^^^^^^^^^^^^^
Ces touches sont utilisées dans le contexte "search" (lorsque @k(C-)@k(r) est
pressé pour chercher du texte dans le tampon).
[width="100%",cols="^.^3,.^10,.^5m",options="header"]
|========================================
| Touche | Description | Commande
| @k(C-)@k(r) | Basculer la casse exacte pour la recherche | /input search_switch_case
| @k(↑) | Chercher la ligne précédente | /input search_previous
| @k(↓) | Chercher la ligne suivante | /input search_next
| @k(Enter) .3+| Arrêter la recherche .3+| /input search_stop
| @k(C-)@k(j)
| @k(C-)@k(m)
|========================================
[[key_bindings_other]]
Autres touches
^^^^^^^^^^^^^^
@@ -90,6 +90,8 @@
| weechat | keys_codes_for_reset | codici tasti che possono essere ripristinati (tasti aggiunti, ridefiniti o rimossi)
| weechat | keys_contexts | key contexts
| weechat | nicks | nick nella lista nick del buffer corrente
| weechat | palette_colors | Tavolozza dei colori
+72 -59
View File
@@ -244,76 +244,89 @@ valore: numero delle voci nella cronologia da mostrare
........................................
/input <azioni> [<argomenti>]
elenco di azioni:
return: simula il tasto "invio"
complete_next: completa la parola con il completamento successivo
complete_previous: completa la parola con il completamento precedente
search_text: cerca testo nel buffer
delete_previous_char: elimina carattere precedente
delete_next_char: elimina carattere successivo
delete_previous_word: elimina parola precedente
delete_next_word: elimina parola successiva
delete_beginning_of_line: elimina da inizio riga fino al cursore
delete_end_of_line: elimina dal cursore fino a fine riga
delete_line: elimina intera riga
clipboard_paste: incolla dagli appunti
transpose_chars: inverti l'ordine di due caratteri
undo: annulla l'ultima azione nella riga di comando
redo: rifai l'ultima azione nella riga di comando
move_beginning_of_line: sposta il cursore ad inizio riga
move_end_of_line: sposta il cursore a fine riga
move_previous_char: sposta cursore al carattere precedente
move_next_char: sposta cursore al carattere successivo
move_previous_word: sposta cursore alla parola precedente
move_next_word: sposta cursore alla parola successiva
history_previous: richiama il comando precedente nella cronologia del buffer corrente
history_next: richiama il comando successivo nella cronologia del buffer corrente
history_global_previous: richiama il comando precedente nella cronologia globale
history_global_next: richiama il comando successivo nella cronologia globale
jump_smart: passa al buffer successivo con attività
jump_last_buffer: passa all'ultimo buffer
jump_previously_visited_buffer: passa al precedente buffer visualizzato
jump_next_visited_buffer: passa al successivo buffer visualizzato
hotlist_clear: elimina hotlist
grab_key: ottiene un tasto
grab_key_command: ottiene un tasto con il suo comando associato
scroll_unread: scorri fino al segnalibro non letto
set_unread: imposta il segnalibro non letto per tutti i buffer
set_unread_current_buffer: imposta il segnalibro non letto per il buffer corrente
switch_active_buffer: passa al successivo buffer incollato
switch_active_buffer_previous: passa al precedente buffer incollato
insert: inserisci testo nella riga di comando
list of actions:
return: simulate key "enter"
complete_next: complete word with next completion
complete_previous: complete word with previous completion
search_text: search text in buffer
search_switch_case: switch exact case for search
search_previous: search previous line
search_next: search next line
search_stop: stop search
delete_previous_char: delete previous char
delete_next_char: delete next char
delete_previous_word: delete previous word
delete_next_word: delete next word
delete_beginning_of_line: delete from beginning of line until cursor
delete_end_of_line: delete from cursor until end of line
delete_line: delete entire line
clipboard_paste: paste from clipboard
transpose_chars: transpose two chars
undo: undo last command line action
redo: redo last command line action
move_beginning_of_line: move cursor to beginning of line
move_end_of_line: move cursor to end of line
move_previous_char: move cursor to previous char
move_next_char: move cursor to next char
move_previous_word: move cursor to previous word
move_next_word: move cursor to next word
history_previous: recall previous command in current buffer history
history_next: recall next command in current buffer history
history_global_previous: recall previous command in global history
history_global_next: recall next command in global history
jump_smart: jump to next buffer with activity
jump_last_buffer: jump to last buffer
jump_previously_visited_buffer: jump to previously visited buffer
jump_next_visited_buffer: jump to next visited buffer
hotlist_clear: clear hotlist
grab_key: grab a key
grab_key_command: grab a key with its associated command
scroll_unread: scroll to unread marker
set_unread: set unread marker for all buffers
set_unread_current_buffer: set unread marker for current buffer
switch_active_buffer: switch to next merged buffer
switch_active_buffer_previous: switch to previous merged buffer
insert: insert text in command line
Questo comando viene usato dall'associazione tasti o dai plugin.
This command is used by key bindings or plugins.
........................................
[command]*`key`* associa/disassocia tasti::
........................................
/key list|listdefault|listdiff
bind <tasto> [<comando> [<args>]]
unbind <tasto>
reset <tasto>
resetall -yes
missing
/key list|listdefault|listdiff [<context>]
bind <key> [<command> [<args>]]
bindctxt <context> <key> [<command> [<args>]]
unbind <key>
unbindctxt <context> <key>
reset <key>
resetctxt <context> <key>
resetall -yes [<context>]
missing [<context>]
list: elenca tutti i tasti correnti (senza argomento, viene visualizzata questa lista)
listdefault: elenca i tasti predefiniti
listdiff: elenca le differenze tra tasti attuali e predefiniti (tasti aggiunti, ridefiniti o eliminati)
bind: associa un comando ad un tasto o visualizza il comando associato al tasto
unbind: rimuove una associazione di tasti
reset: ripristina un tasto all'assegnazione predefinita
resetall: ripristina le associazioni ai valori predefiniti ed elimina TUTTE le associazioni personalizzate (usare con cautela!)
missing: aggiunge tasti mancanti (utilizzando le associazioni predefinite), utile dopo l'installazione di una nuova versione di WeeChat
list: list all current keys (without argument, this list is displayed)
listdefault: list default keys
listdiff: list differences between current and default keys (keys added, redefined or deleted)
context: name of context ("default" or "search")
bind: bind a command to a key or display command bound to key (for context "default")
bindctxt: bind a command to a key or display command bound to key, for given context
unbind: remove a key binding (for context "default")
unbindctxt: remove a key binding for given context
reset: reset a key to default binding (for context "default")
resetctxt: reset a key to default binding, for given context
resetall: restore bindings to the default values and delete ALL personal bindings (use carefully!)
missing: add missing keys (using default bindings), useful after installing new WeeChat version
Al momento di associare un comando ad un tasto si raccomanda di utilizzare il tasto alt+k (oppure Esc e k), e digitare il tasto da associare: il codice tasto verrà inserito nella riga di comando.
When binding a command to a key, it is recommended to use key alt+k (or Esc then k), and then press the key to bind: this will insert key code in command line.
Esempi:
il tasto alt-x per alternare la barra della nicklist:
Examples:
key alt-x to toggle nicklist bar:
/key bind meta-x /bar toggle nicklist
il tasto alt-r per passare al canale IRC #weechat:
key alt-r to jump to #weechat IRC channel:
/key bind meta-r /buffer #weechat
ripristinare l'associazione predefinita per il tasto alt-r:
restore default binding for key alt-r:
/key reset meta-r
key "tab" to stop search in buffer:
/key bindctxt search ctrl-I /input search_stop
........................................
[command]*`layout`* salva/applica/ripristina il layout per i buffer e le finestre::
+21 -1
View File
@@ -444,7 +444,8 @@ Tasti per la riga di comando
| @k(Backsp.) .2+| Elimina il carattere precedente nella riga di comando .2+| /input delete_previous_char
| @k(C-)@k(h)
| @k(C-)@k(k) | Elimina dal cursore fino alla fine della riga di comando (la stringa eliminata viene copiata negli appunti) | /input delete_end_of_line
| @k(C-)@k(r) | Cerca del testo nella cronologia del buffer (due volte: cerca testo esatto), @k(↑): precedente, @k(↓): successivo, @k(Enter): stop | /input search_text
// TRANSLATION MISSING
| @k(C-)@k(r) | Cerca del testo nella cronologia del buffer (see <<key_bindings_search_context,keys for search context>>) | /input search_text
| @k(C-)@k(t) | Inverti caratteri | /input transpose_chars
| @k(C-)@k(u) | Elimina dal cursore fino all'inizio della riga di comando (la stringa eliminata viene copiata negli appunti) | /input delete_beginning_of_line
| @k(C-)@k(w) | Elimina la parola precedente nella riga di comando (la stringa eliminata viene copiata negli appunti) | /input delete_previous_word
@@ -517,6 +518,25 @@ Tasti per buffer / finestre
| @k(A-)@k(>) | Passa al buffer successivo nella lista dei buffer visitati | /input jump_next_visited_buffer
|========================================
// TRANSLATION MISSING
[[key_bindings_search_context]]
Keys for "search" context
^^^^^^^^^^^^^^^^^^^^^^^^^
These keys are used in context "search" (when @k(C-)@k(r) is pressed to search
text in buffer).
[width="100%",cols="^.^3,.^10,.^5m",options="header"]
|========================================
| Key | Description | Command
| @k(C-)@k(r) | Switch exact case for search | /input search_switch_case
| @k(↑) | Search previous line | /input search_previous
| @k(↓) | Search next line | /input search_next
| @k(Enter) .3+| Stop search .3+| /input search_stop
| @k(C-)@k(j)
| @k(C-)@k(m)
|========================================
[[key_bindings_other]]
Altri tasti
^^^^^^^^^^^
+4 -4
View File
@@ -40,14 +40,14 @@
./src/gui/curses/gui-curses-chat.c
./src/gui/curses/gui-curses-color.c
./src/gui/curses/gui-curses.h
./src/gui/curses/gui-curses-keyboard.c
./src/gui/curses/gui-curses-key.c
./src/gui/curses/gui-curses-main.c
./src/gui/curses/gui-curses-window.c
./src/gui/gtk/gui-gtk-bar-window.c
./src/gui/gtk/gui-gtk-chat.c
./src/gui/gtk/gui-gtk-color.c
./src/gui/gtk/gui-gtk.h
./src/gui/gtk/gui-gtk-keyboard.c
./src/gui/gtk/gui-gtk-key.c
./src/gui/gtk/gui-gtk-main.c
./src/gui/gtk/gui-gtk-window.c
./src/gui/gui-bar.c
@@ -72,8 +72,8 @@
./src/gui/gui-hotlist.h
./src/gui/gui-input.c
./src/gui/gui-input.h
./src/gui/gui-keyboard.c
./src/gui/gui-keyboard.h
./src/gui/gui-key.c
./src/gui/gui-key.h
./src/gui/gui-layout.c
./src/gui/gui-layout.h
./src/gui/gui-line.c
+75 -43
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-05-15 10:51+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -79,9 +79,9 @@ msgstr ""
"dokumentacích \n"
" k pluginům)\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "%s výchozí klávesy:\n"
#, c-format
@@ -373,29 +373,52 @@ msgstr "Historie příkazů bufferu:"
msgid "default command:"
msgstr "výchozí příkaz:"
#, c-format
msgid "Key bindings added or redefined (%d):"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Klávesové zkratky přidány nebo předefinovány (%d):"
#, c-format
msgid "Key bindings deleted (%d):"
#, fuzzy, c-format
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Klávesové zkratky smazány (%d):"
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr "Nebyly přidány, předefinovány nebo smazny žádné klávesové zkratky"
msgid "No key binding defined"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sChyba: nemohu napojit kalávesu \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Klávesa \"%s\" již má výhozí hodnotu"
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Klávesa \"%s\" odpojena"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sChyba: nemohu odpojit klávesu \"%s\""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sKlávesa \"%s\" nenalezena"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Žádné klávesové zkratky nejsou definovány"
#, c-format
msgid "Key bindings (%d):"
#, fuzzy, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Klávesové zkratky (%d):"
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "Žádné výchozí klávesové zkratky"
#, c-format
msgid "Default key bindings (%d):"
#, fuzzy, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Výchozí klávesové zkratky (%d):"
msgid "Key:"
@@ -404,27 +427,12 @@ msgstr "Klávesa:"
msgid "No key found"
msgstr "Žádná klávesa nenalezena"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sChyba: nemohu napojit kalávesu \"%s\""
#, fuzzy, c-format
msgid "%sError: context \"%s\" not found"
msgstr "%sChyba: filtr \"%s\" nenalezen"
#, c-format
msgid "Key \"%s\" unbound"
msgstr "Klávesa \"%s\" odpojena"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sChyba: nemohu odpojit klávesu \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Klávesa \"%s\" již má výhozí hodnotu"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sKlávesa \"%s\" nenalezena"
msgid "Default key bindings restored"
#, fuzzy, c-format
msgid "Default key bindings restored for context \"%s\""
msgstr "Výchozí klávesové zkratky obnoveny"
#, c-format
@@ -433,9 +441,9 @@ msgstr ""
"%sChyba: \"-yes\" argument je požadován pro reset kaláves (bezpečnostní "
"opatření)"
#, c-format
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "přidána %d nová klávesa"
msgstr[1] "přidány %d nové klávesy"
msgstr[2] "přidáno %d nových kláves"
@@ -1270,12 +1278,17 @@ msgstr "funkce pro příkazovou řádku"
msgid "<action> [<arguments>]"
msgstr "<action> [<argumenty>]"
#, fuzzy
msgid ""
"list of actions:\n"
" return: simulate key \"enter\"\n"
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1359,22 +1372,32 @@ msgstr ""
msgid "bind/unbind keys"
msgstr "napojit/odpojit klávesy"
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"list|listdefault|listdiff || bind <klávesa> [<příkaz> [<argumenty>]] || "
"unbind <klávesa> || reset <klávesa> || resetall -yes || missing"
#, fuzzy
msgid ""
" list: list all current keys (without argument, this list is "
"displayed)\n"
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1390,7 +1413,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" list: vypsat všechny aktuální klávesy (pokud není vuveden žádný "
"argument, je vypsán tento list)\n"
@@ -1978,9 +2003,16 @@ msgstr "volby pro proxy"
msgid "options for bars"
msgstr "volby pro pole"
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key contexts"
msgstr "klávesové kódy"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr "klávesové kódy"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
"klávesové kódy mohou být resetovány (klávesy přidány, redefinovány nebo "
+75 -43
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-06-15 18:51+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -87,9 +87,9 @@ msgstr ""
"zusätzliche Informationen\n"
" zu den mögliche Optionen zu erhalten.)\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "%s Standardtastenbelegungen:\n"
#, c-format
@@ -386,30 +386,53 @@ msgstr "Befehlsverlauf des Buffers:"
msgid "default command:"
msgstr "Standardbefehl:"
#, c-format
msgid "Key bindings added or redefined (%d):"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Tastenbelegungen die hinzugefügt oder verändert wurden (%d):"
#, c-format
msgid "Key bindings deleted (%d):"
#, fuzzy, c-format
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Tastenbelegungen die gelöscht wurden (%d):"
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr ""
"Es sind keine Tastenbelegungen hinzugefügt, verändert oder gelöscht worden"
msgid "No key binding defined"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sFehler: kann die Taste \"%s\" nicht zuordnen"
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Die Taste \"%s\" ist schon mit einem Standardbefehl belegt"
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Tastenbelegung \"%s\" entfernt"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sFehler: kann die Tastenbelegung \"%s\" nicht entfernen"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTastenbelegung \"%s\" nicht gefunden"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Keine Tastenbelegung definiert"
#, c-format
msgid "Key bindings (%d):"
#, fuzzy, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Tastenbelegungen (%d):"
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "keine Standardtastenbelegungen vorhanden"
#, c-format
msgid "Default key bindings (%d):"
#, fuzzy, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Standardtastenbelegungen (%d):"
msgid "Key:"
@@ -418,27 +441,12 @@ msgstr "Taste:"
msgid "No key found"
msgstr "Keine Taste gefunden"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sFehler: kann die Taste \"%s\" nicht zuordnen"
#, fuzzy, c-format
msgid "%sError: context \"%s\" not found"
msgstr "%sFehler: Filter \"%s\" nicht gefunden"
#, c-format
msgid "Key \"%s\" unbound"
msgstr "Tastenbelegung \"%s\" entfernt"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sFehler: kann die Tastenbelegung \"%s\" nicht entfernen"
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Die Taste \"%s\" ist schon mit einem Standardbefehl belegt"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTastenbelegung \"%s\" nicht gefunden"
msgid "Default key bindings restored"
#, fuzzy, c-format
msgid "Default key bindings restored for context \"%s\""
msgstr "Standardtastenbelegungen wiederhergestellt"
#, c-format
@@ -447,9 +455,9 @@ msgstr ""
"%sFehler: \"-yes\" Argument ist aus Sicherheitsgründen für den Reset der "
"Tastenbelegung notwendig"
#, c-format
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "(%d) neue Taste hinzugefügt"
msgstr[1] "(%d) neue Tasten hinzugefügt"
@@ -1302,12 +1310,17 @@ msgstr "Funktionen für die Befehlszeile"
msgid "<action> [<arguments>]"
msgstr "<action> [<arguments>]"
#, fuzzy
msgid ""
"list of actions:\n"
" return: simulate key \"enter\"\n"
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1402,22 +1415,32 @@ msgstr ""
msgid "bind/unbind keys"
msgstr "Einer Taste einen Befehl zuordnen oder entfernen"
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
#, fuzzy
msgid ""
" list: list all current keys (without argument, this list is "
"displayed)\n"
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1433,7 +1456,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" list: zeigt die aktuelle Tastenbelegungen an (Standardaufruf)\n"
"listdefault: zeigt die Standardeinstellung der Tastenbelegung an\n"
@@ -2057,9 +2082,16 @@ msgstr "Optionen für Proxies"
msgid "options for bars"
msgstr "Optionen für Infobars"
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key contexts"
msgstr "Tastaturcodes"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr "Tastaturcodes"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
"Tastenbelegungen die zurückgesetzt werden können (hinzugefügte/verändert/"
+75 -43
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-05-15 10:51+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -80,9 +80,9 @@ msgstr ""
" (ver la documentación del plugin para más información\n"
" sobre posibles opciones)\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "teclas por defecto de %s:\n"
#, c-format
@@ -377,29 +377,52 @@ msgstr "Historial de comandos:"
msgid "default command:"
msgstr "comando predeterminado:"
#, c-format
msgid "Key bindings added or redefined (%d):"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Atajos agregados o redefinidos (%d):"
#, c-format
msgid "Key bindings deleted (%d):"
#, fuzzy, c-format
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Atajos borrados (%d):"
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr "Ningún atajo agregado, redefinido o borrado"
msgid "No key binding defined"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sError: no se pudo crear el atajo \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Atajo \"%s\" ya tiene un valor por defecto"
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Atajo \"%s\" deshecho"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sError: no se pudo deshacer el atajo \"%s\""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTecla \"%s\" no encontrada"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Ningún atajo definido"
#, c-format
msgid "Key bindings (%d):"
#, fuzzy, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Atajos (%d):"
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "Ningún atajo predefinido"
#, c-format
msgid "Default key bindings (%d):"
#, fuzzy, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Atajos predefinidos (%d):"
msgid "Key:"
@@ -408,27 +431,12 @@ msgstr "Tecla:"
msgid "No key found"
msgstr "Ninguna tecla encontrada"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sError: no se pudo crear el atajo \"%s\""
#, fuzzy, c-format
msgid "%sError: context \"%s\" not found"
msgstr "%sError: filtro \"%s\" no encontrado"
#, c-format
msgid "Key \"%s\" unbound"
msgstr "Atajo \"%s\" deshecho"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sError: no se pudo deshacer el atajo \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Atajo \"%s\" ya tiene un valor por defecto"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTecla \"%s\" no encontrada"
msgid "Default key bindings restored"
#, fuzzy, c-format
msgid "Default key bindings restored for context \"%s\""
msgstr "Atajos predefinidos restaurados"
#, c-format
@@ -437,9 +445,9 @@ msgstr ""
"%sError: por seguridad, se requiere el argumento \"-yes\" para restaurar los "
"atajos"
#, c-format
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "%d nuevo atajo agregado"
msgstr[1] "%d nuevos atajos agregados"
@@ -1278,12 +1286,17 @@ msgstr "funciones para la línea de comandos"
msgid "<action> [<arguments>]"
msgstr "<acción> [<argumentos>]"
#, fuzzy
msgid ""
"list of actions:\n"
" return: simulate key \"enter\"\n"
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1369,22 +1382,32 @@ msgstr ""
msgid "bind/unbind keys"
msgstr "crear/deshacer atajos"
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"list|listdefault|listdiff || bind <tecla> [<comando> [<argumentos>]] || "
"unbind <tecla> || reset <tecla> || resetall -yes || missing"
#, fuzzy
msgid ""
" list: list all current keys (without argument, this list is "
"displayed)\n"
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1400,7 +1423,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" list: lista todas los atajos actuales (sin argumentos, esta lista es "
"mostrada)\n"
@@ -2001,9 +2026,16 @@ msgstr "opciones para proxies"
msgid "options for bars"
msgstr "opciones para barras"
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key contexts"
msgstr "códigos de tecla"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr "códigos de tecla"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
"Atajos que se pueden restaurar (atajos agregados, redefinidos o borrados)"
+98 -53
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"PO-Revision-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-07-04 21:45+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -81,10 +81,10 @@ msgstr ""
"d'information\n"
" sur les options possibles)\n"
#. TRANSLATORS: "%s" is "weechat"
#. TRANSLATORS: first "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
msgstr "Touches par défaut %s:\n"
msgid "%s default keys (context: \"%s\"):\n"
msgstr "Touches par défaut %s (contexte: \"%s\"):\n"
#, c-format
msgid "Error: missing argument for \"%s\" option\n"
@@ -378,29 +378,55 @@ msgid "default command:"
msgstr "commande par défaut:"
#, c-format
msgid "Key bindings added or redefined (%d):"
msgstr "Associations de touches ajoutées ou redéfinies (%d):"
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr ""
"Associations de touches ajoutées ou redéfinies (%d) pour le contexte \"%s\":"
#, c-format
msgid "Key bindings deleted (%d):"
msgstr "Associations de touches supprimées (%d):"
msgid "No key binding added, redefined or removed"
msgstr "Aucune association de touche ajoutée, redéfinie ou supprimée"
msgid "No key binding defined"
msgstr "Pas d'association de touche définie"
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Associations de touches supprimées (%d) pour le contexte \"%s\":"
#, c-format
msgid "Key bindings (%d):"
msgstr "Associations de touches (%d):"
msgid "No default key binding"
msgstr "Pas de touche par défaut"
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr ""
"Aucune association de touche ajoutée, redéfinie ou supprimée pour le "
"contexte \"%s\""
#, c-format
msgid "Default key bindings (%d):"
msgstr "Associations de touches par défaut (%d):"
msgid "%sError: unable to bind key \"%s\""
msgstr "%sErreur: impossible de créer la touche \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "La touche \"%s\" a déjà la valeur par défaut"
#, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Touche \"%s\" supprimée (contexte: \"%s\")"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sErreur: impossible de supprimer la touche \"%s\""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTouche \"%s\" non trouvée"
#, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Pas d'association de touche définie pour le contexte \"%s\""
#, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Associations de touches (%d) pour le contexte \"%s\":"
#, c-format
msgid "No default key binding for context \"%s\""
msgstr "Pas de touche par défaut pour le contexte \"%s\""
#, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Associations de touches par défaut (%d) pour le contexte \"%s\":"
msgid "Key:"
msgstr "Touche:"
@@ -409,27 +435,12 @@ msgid "No key found"
msgstr "Aucune touche trouvée"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sErreur: impossible de créer la touche \"%s\""
msgid "%sError: context \"%s\" not found"
msgstr "%sErreur: contexte \"%s\" non trouvé"
#, c-format
msgid "Key \"%s\" unbound"
msgstr "Touche \"%s\" supprimée"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sErreur: impossible de supprimer la touche \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "La touche \"%s\" a déjà la valeur par défaut"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTouche \"%s\" non trouvée"
msgid "Default key bindings restored"
msgstr "Touches par défaut restaurées"
msgid "Default key bindings restored for context \"%s\""
msgstr "Touches par défaut restaurées pour le contexte \"%s\""
#, c-format
msgid "%sError: \"-yes\" argument is required for keys reset (security reason)"
@@ -439,9 +450,9 @@ msgstr ""
#, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgstr[0] "%d nouvelle touche ajoutée"
msgstr[1] "%d nouvelles touches ajoutées"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "%d nouvelle touche ajoutée (contexte: \"%s\")"
msgstr[1] "%d nouvelles touches ajoutées (contexte: \"%s\")"
#, c-format
msgid "leaf: id: %d, parent: %d, plugin: \"%s\", buffer: \"%s\""
@@ -1287,6 +1298,10 @@ msgid ""
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1329,6 +1344,10 @@ msgstr ""
" complete_next: compléter le mot avec la complétion suivante\n"
" complete_previous: compléter le mot avec la complétion précédente\n"
" search_text: chercher du texte dans le tampon\n"
" search_switch_case: basculer la casse exacte pour la recherche\n"
" search_previous: chercher la ligne précédente\n"
" search_next: chercher la ligne suivante\n"
" search_stop: arrêter la recherche\n"
" delete_previous_char: effacer le caractère précédent\n"
" delete_next_char: effacer le caractère suivant\n"
" delete_previous_word: effacer le mot précédent\n"
@@ -1375,11 +1394,15 @@ msgid "bind/unbind keys"
msgstr "associer/libérer des touches"
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"list|listdefault|listdiff || bind <touche> [<commande> [<args>]] || unbind "
"<touche> || reset <touche> || resetall -yes || missing"
"list|listdefault|listdiff [<contexte>] || bind <touche> [<commande> "
"[<args>]] || bindctxt <contexte> <touche> [<commande> [<args>]] || unbind "
"<touche> || unbindctxt <contexte> <touche> || reset <touche> || resetctxt "
"<contexte> <touche> || resetall -yes [<contexte>] || missing [<contexte>]"
msgid ""
" list: list all current keys (without argument, this list is "
@@ -1387,9 +1410,15 @@ msgid ""
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1405,17 +1434,25 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" list: afficher toutes les touches courantes (sans paramètre, cette "
"liste est affichée)\n"
"listdefault: afficher les touches par défaut\n"
" listdiff: afficher les différences entre les touches courantes et celles "
"par défaut (touches ajoutées, redéfinies ou supprimées)\n"
" contexte: nom du contexte (\"default\" ou \"search\")\n"
" bind: associer une commande à une touche ou affiche la commande "
"associée à la touche\n"
" bindctxt: associer une commande à une touche ou affiche la commande "
"associée à la touche pour le contexte donné\n"
" unbind: supprimer l'association à une touche\n"
" unbindctxt: supprimer l'association à une touche pour le contexte donné\n"
" reset: réinitialiser une touche à son association par défaut\n"
" resetctxt: réinitialiser une touche à son association par défaut pour le "
"contexte donné\n"
" resetall: restaurer les touches aux valeurs par défaut et supprimer "
"TOUTES les touches personnelles (utiliser avec précaution !)\n"
" missing: ajouter les touches manquantes (en utilisant les touches par "
@@ -1431,7 +1468,9 @@ msgstr ""
" touche alt-r pour aller sur le canal IRC #weechat:\n"
" /key bind meta-r /buffer #weechat\n"
" restaure l'association par défaut pour la touche alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" touche \"tab\" pour arrêter la recherche dans le tampon:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgid "save/apply/reset layout for buffers and windows"
msgstr "sauver/appliquer/réinitialiser la disposition des tampons et fenêtres"
@@ -2009,9 +2048,15 @@ msgstr "options pour les proxies"
msgid "options for bars"
msgstr "options pour les barres"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key contexts"
msgstr "contextes de touches"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr "codes des touches"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
"codes des touches pouvant être réinitialisées (touches ajoutées, redéfinies "
+64 -40
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-05-15 10:51+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -75,9 +75,9 @@ msgstr ""
" -v, --version WeeChat verziójának mutatása\n"
" -w, --weechat-commands WeeChat parancsok mutatása\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "%s alapértelmezett billentyűk:\n"
#, fuzzy, c-format
@@ -390,31 +390,51 @@ msgid "default command:"
msgstr "%s belső parancsok:\n"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d):"
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Billentyűparancsok:\n"
#, fuzzy, c-format
msgid "Key bindings deleted (%d):"
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Billentyűparancsok:\n"
#, fuzzy
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr "Billentyűparancsok:\n"
#, fuzzy
msgid "No key binding defined"
#, fuzzy, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni\n"
#, c-format
msgid "Key \"%s\" has already default value"
msgstr ""
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "A(z) \"%s\" billentyűparancs visszavonva\n"
#, fuzzy, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%s nem sikerült a(z) \"%s\" billentyűparancsot visszavonni\n"
#, fuzzy, c-format
msgid "%sKey \"%s\" not found"
msgstr "%s a \"%s\" szerver nem található\n"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Nincs aliasz definiálva.\n"
#, fuzzy, c-format
msgid "Key bindings (%d):"
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Billentyűparancsok:\n"
#, fuzzy
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "Alapértelmezett billentyűparancsok visszaállítva\n"
#, fuzzy, c-format
msgid "Default key bindings (%d):"
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Alapértelmezett billentyűparancsok visszaállítva\n"
#, fuzzy
@@ -426,27 +446,11 @@ msgid "No key found"
msgstr "Nem találtam billentyűt.\n"
#, fuzzy, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni\n"
msgid "%sError: context \"%s\" not found"
msgstr "%s a \"%s\" modul nem található\n"
#, fuzzy, c-format
msgid "Key \"%s\" unbound"
msgstr "A(z) \"%s\" billentyűparancs visszavonva\n"
#, fuzzy, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%s nem sikerült a(z) \"%s\" billentyűparancsot visszavonni\n"
#, c-format
msgid "Key \"%s\" has already default value"
msgstr ""
#, fuzzy, c-format
msgid "%sKey \"%s\" not found"
msgstr "%s a \"%s\" szerver nem található\n"
#, fuzzy
msgid "Default key bindings restored"
msgid "Default key bindings restored for context \"%s\""
msgstr "Alapértelmezett billentyűparancsok visszaállítva\n"
#, fuzzy, c-format
@@ -457,7 +461,7 @@ msgstr ""
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "Nincs mellőzés megadva.\n"
msgstr[1] "Nincs mellőzés megadva.\n"
@@ -1164,6 +1168,10 @@ msgid ""
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1207,8 +1215,10 @@ msgstr "billentyűk hozzárendelése/hozzárendelés eltávolítása"
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"[billentyű [funkció/parancs]] [unbind billentyű] [funkciók] [call funkció "
"[\"paraméterek\"]] [reset -yes]"
@@ -1220,9 +1230,15 @@ msgid ""
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1238,7 +1254,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
"billentyű: billentyű hozzárendelése valamely belső funkcióhoz vagy \"/\" "
"jellel kezdődő parancshoz\n"
@@ -1693,9 +1711,15 @@ msgstr "Aliaszok listája:\n"
msgid "options for bars"
msgstr "Aliaszok listája:\n"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key contexts"
msgstr ""
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr ""
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr "Billentyűparancsok:\n"
+75 -43
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -79,9 +79,9 @@ msgstr ""
" (consultare la documentazione per maggiori\n"
" informazioni sulle opzioni disponibili)\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "tasti predefiniti di %s:\n"
#, c-format
@@ -373,29 +373,52 @@ msgstr "Cronologia comandi buffer:"
msgid "default command:"
msgstr "comando predefinito:"
#, c-format
msgid "Key bindings added or redefined (%d):"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Associazioni tasti aggiunte o ridefinite (%d):"
#, c-format
msgid "Key bindings deleted (%d):"
#, fuzzy, c-format
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Associazioni tasti rimosse (%d):"
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr "Nessuna combinazione tasti aggiunta, ridefinita o rimossa"
msgid "No key binding defined"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sErrore: impossibile associare il tasto \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Il tasto \"%s\" ha già un valore predefinito"
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Tasto \"%s\" non associato"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sErrore: impossibile rimuovere l'associazione del tasto \"%s\""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTasto \"%s\" non trovato"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Nessuna combinazione tasti definita"
#, c-format
msgid "Key bindings (%d):"
#, fuzzy, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Combinazioni (%d):"
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "Nessuna associazione tasti predefinita"
#, c-format
msgid "Default key bindings (%d):"
#, fuzzy, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Associazione tasti predefinita (%d):"
msgid "Key:"
@@ -404,27 +427,12 @@ msgstr "Tasto:"
msgid "No key found"
msgstr "Nessun tasto trovato"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sErrore: impossibile associare il tasto \"%s\""
#, fuzzy, c-format
msgid "%sError: context \"%s\" not found"
msgstr "%sErrore: filtro \"%s\" non trovato"
#, c-format
msgid "Key \"%s\" unbound"
msgstr "Tasto \"%s\" non associato"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sErrore: impossibile rimuovere l'associazione del tasto \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Il tasto \"%s\" ha già un valore predefinito"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTasto \"%s\" non trovato"
msgid "Default key bindings restored"
#, fuzzy, c-format
msgid "Default key bindings restored for context \"%s\""
msgstr "Associazione tasti predefinita ripristinata"
#, c-format
@@ -433,9 +441,9 @@ msgstr ""
"%sErrore: l'argomento \"-yes\" è richiesto per il reset dei tasti (motivi di "
"sicurezza)"
#, c-format
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "%d nuovo tasto aggiunto"
msgstr[1] "%d nuovi tasti aggiunti"
@@ -1271,12 +1279,17 @@ msgstr "funzioni per la riga di comando"
msgid "<action> [<arguments>]"
msgstr "<azioni> [<argomenti>]"
#, fuzzy
msgid ""
"list of actions:\n"
" return: simulate key \"enter\"\n"
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1364,22 +1377,32 @@ msgstr ""
msgid "bind/unbind keys"
msgstr "associa/disassocia tasti"
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"list|listdefault|listdiff || bind <tasto> [<comando> [<args>]] || unbind "
"<tasto> || reset <tasto> || resetall -yes || missing"
#, fuzzy
msgid ""
" list: list all current keys (without argument, this list is "
"displayed)\n"
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1395,7 +1418,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" list: elenca tutti i tasti correnti (senza argomento, viene "
"visualizzata questa lista)\n"
@@ -1997,9 +2022,16 @@ msgstr "opzioni per i proxy"
msgid "options for bars"
msgstr "opzioni per le barre"
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key contexts"
msgstr "codici tasti"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr "codici tasti"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
"codici tasti che possono essere ripristinati (tasti aggiunti, ridefiniti o "
+75 -43
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -82,9 +82,9 @@ msgstr ""
" (zajrzyj do dokumentacji wtyczek po więcej informacji\n"
" o dostępnych opcjach)\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "Domyślne skróty klawiszowe %s:\n"
#, c-format
@@ -376,29 +376,52 @@ msgstr "Historia komend bufora:"
msgid "default command:"
msgstr "domyślna komenda:"
#, c-format
msgid "Key bindings added or redefined (%d):"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Dodane lub przedefiniowane skróty klawiszowe (%d):"
#, c-format
msgid "Key bindings deleted (%d):"
#, fuzzy, c-format
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Usunięte skróty klawiszowe (%d):"
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr "Nie dodano, usunięto lub zmieniono żadnego skrótu klawiszowego"
msgid "No key binding defined"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sBłąd: nie można przypisać klawisza \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Klawisz \"%s\" juz ma domyślną wartość"
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Klawisz \"%s\" nieprzypisany"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sBłąd: nie można odbindować klawisza \"%s\""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sKlawisz \"%s\" nie znaleziony"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Nie zdefiniowano powiązań klawiszy"
#, c-format
msgid "Key bindings (%d):"
#, fuzzy, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Powiązania klawiszy (%d):"
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "Brak domyślnych skrótów klawiszowych"
#, c-format
msgid "Default key bindings (%d):"
#, fuzzy, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Domyślne skróty klawiszowe (%d):"
msgid "Key:"
@@ -407,27 +430,12 @@ msgstr "Klawisz:"
msgid "No key found"
msgstr "Nie znaleziono klawisza"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sBłąd: nie można przypisać klawisza \"%s\""
#, fuzzy, c-format
msgid "%sError: context \"%s\" not found"
msgstr "%sBłąd: nie odnaleziono filtru \"%s\""
#, c-format
msgid "Key \"%s\" unbound"
msgstr "Klawisz \"%s\" nieprzypisany"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sBłąd: nie można odbindować klawisza \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Klawisz \"%s\" juz ma domyślną wartość"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sKlawisz \"%s\" nie znaleziony"
msgid "Default key bindings restored"
#, fuzzy, c-format
msgid "Default key bindings restored for context \"%s\""
msgstr "Przywrócono domyślne ustawienia klawiszy"
#, c-format
@@ -436,9 +444,9 @@ msgstr ""
"%sBłąd: argument \"-yes\" wymagany do zresetowania ustawień klawiszy "
"(względy bezpieczeństwa)"
#, c-format
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "dodano %d nowy klawisz"
msgstr[1] "dodano %d nowe klawisze"
msgstr[2] "dodano %d nowych klawiszy"
@@ -1281,12 +1289,17 @@ msgstr "funkcje linii komend"
msgid "<action> [<arguments>]"
msgstr "<akcja> [<argumenty>]"
#, fuzzy
msgid ""
"list of actions:\n"
" return: simulate key \"enter\"\n"
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1373,22 +1386,32 @@ msgstr ""
msgid "bind/unbind keys"
msgstr "dodaj/usuń przypisanie klawiszy"
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"list|listdefault|listdiff || bind <klawisz> [<komenda> [<argumenty>]] || "
"unbind <klawisz> || reset <klawisz> || resetall -yes || missing"
#, fuzzy
msgid ""
" list: list all current keys (without argument, this list is "
"displayed)\n"
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1404,7 +1427,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" list: wyświetla wszystkie obecne skróty (bez podanego argumentu, "
"pokazywana jest ta lista)\n"
@@ -2002,9 +2027,16 @@ msgstr "opcje proxy"
msgid "options for bars"
msgstr "opcje pasków"
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key contexts"
msgstr "kody klawiszowe"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr "kody klawiszowe"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
"kody klawiszy, które mogą być zresetowane (klawisze dodane, zredefiniowane "
+73 -42
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -81,9 +81,9 @@ msgstr ""
"informações\n"
" sobre possíveis plugins)\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "%s teclas de atalho padrão:\n"
#, c-format
@@ -379,29 +379,52 @@ msgstr "Histórico de comandos de buffer:"
msgid "default command:"
msgstr "comando padrão:"
#, c-format
msgid "Key bindings added or redefined (%d):"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Atalhos de teclado adicionados ou redefinidos (%d):"
#, c-format
msgid "Key bindings deleted (%d):"
#, fuzzy, c-format
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Atalhos de teclado deletados (%d):"
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr "Nenhum atalho de teclado adicionado, redefinido ou removido"
msgid "No key binding defined"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sErro: incapaz de associar o atalho à tecla \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Tecla \"%s\" já possui valor padrão"
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Tecla \"%s\" não associada à nenhum atalho"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sErro: incapaz de desassociar a tecla de atalho \"%s\""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTecla \"%s\" não encontrada"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Nenhum atalho de teclado definido"
#, c-format
msgid "Key bindings (%d):"
#, fuzzy, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Atalhos de teclado (%d):"
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "Nenhum atalho de teclado padrão"
#, c-format
msgid "Default key bindings (%d):"
#, fuzzy, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Atalhos de teclado padrão (%d):"
msgid "Key:"
@@ -410,27 +433,12 @@ msgstr "Tecla:"
msgid "No key found"
msgstr "Nenhuma tecla encontrada"
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%sErro: incapaz de associar o atalho à tecla \"%s\""
#, fuzzy, c-format
msgid "%sError: context \"%s\" not found"
msgstr "%sErro: filtro \"%s\" não encontrado"
#, fuzzy, c-format
msgid "Key \"%s\" unbound"
msgstr "Tecla \"%s\" não associada à nenhum atalho"
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%sErro: incapaz de desassociar a tecla de atalho \"%s\""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr "Tecla \"%s\" já possui valor padrão"
#, c-format
msgid "%sKey \"%s\" not found"
msgstr "%sTecla \"%s\" não encontrada"
msgid "Default key bindings restored"
msgid "Default key bindings restored for context \"%s\""
msgstr "Atalhos de teclado padrão restaurados"
#, fuzzy, c-format
@@ -439,9 +447,9 @@ msgstr ""
"%sErro: argumento \"-yes\" é requerido para as teclas de reset (razões de "
"segurança)"
#, c-format
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "%d nova tecla adicionada"
msgstr[1] "%d novas teclas adicionadas"
@@ -1288,6 +1296,10 @@ msgid ""
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1371,22 +1383,32 @@ msgid "bind/unbind keys"
msgstr "vincular/desvincular teclas"
# it may be needed to translate this
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"list|listdefault|listdiff || bind <tecla> [<comando> [<args>]] || unbind "
"<tecla> || reset <tecla> || resetall -yes || missing"
#, fuzzy
msgid ""
" list: list all current keys (without argument, this list is "
"displayed)\n"
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1402,7 +1424,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" list: lista todos as teclas atuais (sem argumentos, esta lista é "
"mostrada)\n"
@@ -2002,9 +2026,16 @@ msgstr "opções para proxys"
msgid "options for bars"
msgstr "opções para barras"
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key contexts"
msgstr "códigos de tecla"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr "códigos de tecla"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
"códigos de tecla que podem ser restaurados (teclas adicionadas, redefinidas "
+64 -40
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.6-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: 2011-05-15 10:52+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -78,9 +78,9 @@ msgstr ""
" -v, --version отобразить версию WeeChat\n"
" -w, --weechat-commands отобразить команды WeeChat\n"
#. TRANSLATORS: "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
#. TRANSLATORS: first "%s" is "weechat"
#, fuzzy, c-format
msgid "%s default keys (context: \"%s\"):\n"
msgstr "%s клавиши по умолчанию:\n"
#, fuzzy, c-format
@@ -393,31 +393,51 @@ msgid "default command:"
msgstr "Внутренние команды %s:\n"
#, fuzzy, c-format
msgid "Key bindings added or redefined (%d):"
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr "Комбинации клавиш:\n"
#, fuzzy, c-format
msgid "Key bindings deleted (%d):"
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr "Комбинации клавиш:\n"
#, fuzzy
msgid "No key binding added, redefined or removed"
#, fuzzy, c-format
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr "Комбинации клавиш:\n"
#, fuzzy
msgid "No key binding defined"
#, fuzzy, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%s не могу установить клавишу \"%s\"\n"
#, c-format
msgid "Key \"%s\" has already default value"
msgstr ""
#, fuzzy, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr "Клавиша \"%s\" не привязана\n"
#, fuzzy, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%s не могу отвязать клавишу \"%s\"\n"
#, fuzzy, c-format
msgid "%sKey \"%s\" not found"
msgstr "%s сервер \"%s\" не найден\n"
#, fuzzy, c-format
msgid "No key binding defined for context \"%s\""
msgstr "Сокращения не заданы.\n"
#, fuzzy, c-format
msgid "Key bindings (%d):"
msgid "Key bindings (%d) for context \"%s\":"
msgstr "Комбинации клавиш:\n"
#, fuzzy
msgid "No default key binding"
#, fuzzy, c-format
msgid "No default key binding for context \"%s\""
msgstr "Комбинации клавиш по умолчанию восстановлены\n"
#, fuzzy, c-format
msgid "Default key bindings (%d):"
msgid "Default key bindings (%d) for context \"%s\":"
msgstr "Комбинации клавиш по умолчанию восстановлены\n"
#, fuzzy
@@ -429,27 +449,11 @@ msgid "No key found"
msgstr "Клавиши не найдены.\n"
#, fuzzy, c-format
msgid "%sError: unable to bind key \"%s\""
msgstr "%s не могу установить клавишу \"%s\"\n"
msgid "%sError: context \"%s\" not found"
msgstr "%s plugin \"%s\" не найден\n"
#, fuzzy, c-format
msgid "Key \"%s\" unbound"
msgstr "Клавиша \"%s\" не привязана\n"
#, fuzzy, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr "%s не могу отвязать клавишу \"%s\"\n"
#, c-format
msgid "Key \"%s\" has already default value"
msgstr ""
#, fuzzy, c-format
msgid "%sKey \"%s\" not found"
msgstr "%s сервер \"%s\" не найден\n"
#, fuzzy
msgid "Default key bindings restored"
msgid "Default key bindings restored for context \"%s\""
msgstr "Комбинации клавиш по умолчанию восстановлены\n"
#, fuzzy, c-format
@@ -459,7 +463,7 @@ msgstr ""
#, fuzzy, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] "Игнорирования не заданы.\n"
msgstr[1] "Игнорирования не заданы.\n"
msgstr[2] "Игнорирования не заданы.\n"
@@ -1172,6 +1176,10 @@ msgid ""
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1215,8 +1223,10 @@ msgstr "установить/снять клавиши"
#, fuzzy
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
"[клавиша [функция/команда]] [unbind клавиша] [функции] [call функция "
"[\"аргументы\"]] [reset -yes]"
@@ -1228,9 +1238,15 @@ msgid ""
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1246,7 +1262,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
" клавиша: отобразить или назначить этой клавише функцию или команду "
"(начинающуюся на \"/\")\n"
@@ -1702,9 +1720,15 @@ msgstr "Список сокращений:\n"
msgid "options for bars"
msgstr "Список сокращений:\n"
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key contexts"
msgstr ""
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr ""
#. TRANSLATORS: "key" means "key on the keyboard"
#, fuzzy
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr "Комбинации клавиш:\n"
+4 -4
View File
@@ -41,14 +41,14 @@ SET(WEECHAT_SOURCES
./src/gui/curses/gui-curses-chat.c
./src/gui/curses/gui-curses-color.c
./src/gui/curses/gui-curses.h
./src/gui/curses/gui-curses-keyboard.c
./src/gui/curses/gui-curses-key.c
./src/gui/curses/gui-curses-main.c
./src/gui/curses/gui-curses-window.c
./src/gui/gtk/gui-gtk-bar-window.c
./src/gui/gtk/gui-gtk-chat.c
./src/gui/gtk/gui-gtk-color.c
./src/gui/gtk/gui-gtk.h
./src/gui/gtk/gui-gtk-keyboard.c
./src/gui/gtk/gui-gtk-key.c
./src/gui/gtk/gui-gtk-main.c
./src/gui/gtk/gui-gtk-window.c
./src/gui/gui-bar.c
@@ -73,8 +73,8 @@ SET(WEECHAT_SOURCES
./src/gui/gui-hotlist.h
./src/gui/gui-input.c
./src/gui/gui-input.h
./src/gui/gui-keyboard.c
./src/gui/gui-keyboard.h
./src/gui/gui-key.c
./src/gui/gui-key.h
./src/gui/gui-layout.c
./src/gui/gui-layout.h
./src/gui/gui-line.c
+68 -40
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2011-06-29 10:27+0200\n"
"POT-Creation-Date: 2011-07-05 11:34+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -47,9 +47,9 @@ msgid ""
" about possible options)\n"
msgstr ""
#. TRANSLATORS: "%s" is "weechat"
#. TRANSLATORS: first "%s" is "weechat"
#, c-format
msgid "%s default keys:\n"
msgid "%s default keys (context: \"%s\"):\n"
msgstr ""
#, c-format
@@ -335,28 +335,51 @@ msgid "default command:"
msgstr ""
#, c-format
msgid "Key bindings added or redefined (%d):"
msgid "Key bindings added or redefined (%d) for context \"%s\":"
msgstr ""
#, c-format
msgid "Key bindings deleted (%d):"
msgstr ""
msgid "No key binding added, redefined or removed"
msgstr ""
msgid "No key binding defined"
msgid "Key bindings deleted (%d) for context \"%s\":"
msgstr ""
#, c-format
msgid "Key bindings (%d):"
msgstr ""
msgid "No default key binding"
msgid "No key binding added, redefined or removed for context \"%s\""
msgstr ""
#, c-format
msgid "Default key bindings (%d):"
msgid "%sError: unable to bind key \"%s\""
msgstr ""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr ""
#, c-format
msgid "Key \"%s\" unbound (context: \"%s\")"
msgstr ""
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr ""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr ""
#, c-format
msgid "No key binding defined for context \"%s\""
msgstr ""
#, c-format
msgid "Key bindings (%d) for context \"%s\":"
msgstr ""
#, c-format
msgid "No default key binding for context \"%s\""
msgstr ""
#, c-format
msgid "Default key bindings (%d) for context \"%s\":"
msgstr ""
msgid "Key:"
@@ -366,26 +389,11 @@ msgid "No key found"
msgstr ""
#, c-format
msgid "%sError: unable to bind key \"%s\""
msgid "%sError: context \"%s\" not found"
msgstr ""
#, c-format
msgid "Key \"%s\" unbound"
msgstr ""
#, c-format
msgid "%sError: unable to unbind key \"%s\""
msgstr ""
#, c-format
msgid "Key \"%s\" has already default value"
msgstr ""
#, c-format
msgid "%sKey \"%s\" not found"
msgstr ""
msgid "Default key bindings restored"
msgid "Default key bindings restored for context \"%s\""
msgstr ""
#, c-format
@@ -394,7 +402,7 @@ msgstr ""
#, c-format
msgid "%d new key added"
msgid_plural "%d new keys added"
msgid_plural "%d new keys added (context: \"%s\")"
msgstr[0] ""
msgstr[1] ""
@@ -1016,6 +1024,10 @@ msgid ""
" complete_next: complete word with next completion\n"
" complete_previous: complete word with previous completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -1058,8 +1070,10 @@ msgid "bind/unbind keys"
msgstr ""
msgid ""
"list|listdefault|listdiff || bind <key> [<command> [<args>]] || unbind <key> "
"|| reset <key> || resetall -yes || missing"
"list|listdefault|listdiff [<context>] || bind <key> [<command> [<args>]] || "
"bindctxt <context> <key> [<command> [<args>]] || unbind <key> || unbindctxt "
"<context> <key> || reset <key> || resetctxt <context> <key> || resetall -yes "
"[<context>] || missing [<context>]"
msgstr ""
msgid ""
@@ -1068,9 +1082,15 @@ msgid ""
"listdefault: list default keys\n"
" listdiff: list differences between current and default keys (keys added, "
"redefined or deleted)\n"
" bind: bind a command to a key or display command bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
" context: name of context (\"default\" or \"search\")\n"
" bind: bind a command to a key or display command bound to key (for "
"context \"default\")\n"
" bindctxt: bind a command to a key or display command bound to key, for "
"given context\n"
" unbind: remove a key binding (for context \"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for context \"default\")\n"
" resetctxt: reset a key to default binding, for given context\n"
" resetall: restore bindings to the default values and delete ALL personal "
"bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), useful after "
@@ -1086,7 +1106,9 @@ msgid ""
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"
msgstr ""
msgid "save/apply/reset layout for buffers and windows"
@@ -1464,9 +1486,15 @@ msgstr ""
msgid "options for bars"
msgstr ""
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key contexts"
msgstr ""
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes"
msgstr ""
#. TRANSLATORS: "key" means "key on the keyboard"
msgid "key codes that can be reset (keys added, redefined or removed)"
msgstr ""
+365 -153
View File
@@ -59,7 +59,7 @@
#include "../gui/gui-history.h"
#include "../gui/gui-hotlist.h"
#include "../gui/gui-input.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-key.h"
#include "../gui/gui-layout.h"
#include "../gui/gui-main.h"
#include "../gui/gui-window.h"
@@ -2123,6 +2123,14 @@ COMMAND_CALLBACK(input)
gui_input_complete_previous (buffer);
else if (string_strcasecmp (argv[1], "search_text") == 0)
gui_input_search_text (buffer);
else if (string_strcasecmp (argv[1], "search_previous") == 0)
gui_input_search_previous (buffer);
else if (string_strcasecmp (argv[1], "search_next") == 0)
gui_input_search_next (buffer);
else if (string_strcasecmp (argv[1], "search_switch_case") == 0)
gui_input_search_switch_case (buffer);
else if (string_strcasecmp (argv[1], "search_stop") == 0)
gui_input_search_stop (buffer);
else if (string_strcasecmp (argv[1], "delete_previous_char") == 0)
gui_input_delete_previous_char (buffer);
else if (string_strcasecmp (argv[1], "delete_next_char") == 0)
@@ -2208,7 +2216,7 @@ command_key_display (struct t_gui_key *key, struct t_gui_key *default_key)
char str_spaces[20 + 1];
int length_screen, num_spaces;
expanded_name = gui_keyboard_get_expanded_name (key->key);
expanded_name = gui_key_get_expanded_name (key->key);
str_spaces[0] = '\0';
length_screen = utf8_strlen_screen ((expanded_name) ?
@@ -2255,17 +2263,20 @@ command_key_display (struct t_gui_key *key, struct t_gui_key *default_key)
void
command_key_display_list (const char *message_no_key,
const char *message_keys,
int context,
struct t_gui_key *keys,
int keys_count)
{
struct t_gui_key *ptr_key;
if (keys_count == 0)
gui_chat_printf (NULL, message_no_key);
gui_chat_printf (NULL, message_no_key,
gui_key_context_string[context]);
else
{
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, message_keys, keys_count);
gui_chat_printf (NULL, message_keys,
keys_count, gui_key_context_string[context]);
for (ptr_key = keys; ptr_key; ptr_key = ptr_key->next_key)
{
command_key_display (ptr_key, NULL);
@@ -2279,17 +2290,17 @@ command_key_display_list (const char *message_no_key,
*/
void
command_key_display_listdiff ()
command_key_display_listdiff (int context)
{
struct t_gui_key *ptr_key, *ptr_default_key;
int count_added, count_deleted;
/* list keys added or redefined */
count_added = 0;
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
for (ptr_key = gui_keys[context]; ptr_key; ptr_key = ptr_key->next_key)
{
ptr_default_key = gui_keyboard_search (gui_default_keys,
ptr_key->key);
ptr_default_key = gui_key_search (gui_default_keys[context],
ptr_key->key);
if (!ptr_default_key
|| (strcmp (ptr_default_key->command, ptr_key->command) != 0))
{
@@ -2299,12 +2310,15 @@ command_key_display_listdiff ()
if (count_added > 0)
{
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, _("Key bindings added or redefined (%d):"),
count_added);
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
gui_chat_printf (NULL,
_("Key bindings added or redefined (%d) for "
"context \"%s\":"),
count_added,
_(gui_key_context_string[context]));
for (ptr_key = gui_keys[context]; ptr_key; ptr_key = ptr_key->next_key)
{
ptr_default_key = gui_keyboard_search (gui_default_keys,
ptr_key->key);
ptr_default_key = gui_key_search (gui_default_keys[context],
ptr_key->key);
if (!ptr_default_key
|| (strcmp (ptr_default_key->command, ptr_key->command) != 0))
{
@@ -2315,21 +2329,24 @@ command_key_display_listdiff ()
/* list keys deleted */
count_deleted = 0;
for (ptr_default_key = gui_default_keys; ptr_default_key;
for (ptr_default_key = gui_default_keys[context]; ptr_default_key;
ptr_default_key = ptr_default_key->next_key)
{
ptr_key = gui_keyboard_search (gui_keys, ptr_default_key->key);
ptr_key = gui_key_search (gui_keys[context], ptr_default_key->key);
if (!ptr_key)
count_deleted++;
}
}
if (count_deleted > 0)
{
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, _("Key bindings deleted (%d):"), count_deleted);
for (ptr_default_key = gui_default_keys; ptr_default_key;
gui_chat_printf (NULL,
_("Key bindings deleted (%d) for context \"%s\":"),
count_deleted,
_(gui_key_context_string[context]));
for (ptr_default_key = gui_default_keys[context]; ptr_default_key;
ptr_default_key = ptr_default_key->next_key)
{
ptr_key = gui_keyboard_search (gui_keys, ptr_default_key->key);
ptr_key = gui_key_search (gui_keys[context], ptr_default_key->key);
if (!ptr_key)
{
command_key_display (ptr_default_key, NULL);
@@ -2341,10 +2358,104 @@ command_key_display_listdiff ()
if ((count_added == 0) && (count_deleted == 0))
{
gui_chat_printf (NULL,
_("No key binding added, redefined or removed"));
_("No key binding added, redefined or removed "
"for context \"%s\""),
_(gui_key_context_string[context]));
}
}
/*
* command_key_reset: reset a key for a given context
*/
int
command_key_reset (int context, const char *key)
{
char *internal_code;
struct t_gui_key *ptr_key, *ptr_default_key, *ptr_new_key;
internal_code = gui_key_get_internal_code (key);
if (!internal_code)
return WEECHAT_RC_ERROR;
ptr_key = gui_key_search (gui_keys[context],
internal_code);
ptr_default_key = gui_key_search (gui_default_keys[context],
internal_code);
free (internal_code);
if (ptr_key || ptr_default_key)
{
if (ptr_key && ptr_default_key)
{
if (strcmp (ptr_key->command, ptr_default_key->command) != 0)
{
gui_key_verbose = 1;
ptr_new_key = gui_key_bind (NULL, context, key,
ptr_default_key->command);
gui_key_verbose = 0;
if (!ptr_new_key)
{
gui_chat_printf (NULL,
_("%sError: unable to bind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
key);
return WEECHAT_RC_OK;
}
}
else
{
gui_chat_printf (NULL,
_("Key \"%s\" has already default "
"value"),
key);
}
}
else if (ptr_key)
{
/* no default key, so just unbind key */
if (gui_key_unbind (NULL, context, key, 1))
{
gui_chat_printf (NULL,
_("Key \"%s\" unbound (context: \"%s\")"),
key,
gui_key_context_string[context]);
}
else
{
gui_chat_printf (NULL,
_("%sError: unable to unbind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
key);
return WEECHAT_RC_OK;
}
}
else
{
/* no key, but default key exists */
gui_key_verbose = 1;
ptr_new_key = gui_key_bind (NULL, context, key,
ptr_default_key->command);
gui_key_verbose = 0;
if (!ptr_new_key)
{
gui_chat_printf (NULL,
_("%sError: unable to bind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
key);
return WEECHAT_RC_OK;
}
}
}
else
{
gui_chat_printf (NULL, _("%sKey \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
key);
}
return WEECHAT_RC_OK;
}
/*
* command_key: bind/unbind keys
*/
@@ -2352,8 +2463,8 @@ command_key_display_listdiff ()
COMMAND_CALLBACK(key)
{
char *internal_code;
struct t_gui_key *ptr_key, *ptr_default_key, *ptr_new_key;
int old_keys_count, keys_added;
struct t_gui_key *ptr_new_key;
int old_keys_count, keys_added, i, context;
/* make C compiler happy */
(void) data;
@@ -2362,39 +2473,68 @@ COMMAND_CALLBACK(key)
/* display all key bindings (current keys) */
if ((argc == 1) || (string_strcasecmp (argv[1], "list") == 0))
{
command_key_display_list (_("No key binding defined"),
_("Key bindings (%d):"),
gui_keys,
gui_keys_count);
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
if ((argc < 3)
|| (string_strcasecmp (argv[2], gui_key_context_string[i]) == 0))
{
command_key_display_list (_("No key binding defined for "
"context \"%s\""),
_("Key bindings (%d) for "
"context \"%s\":"),
i, gui_keys[i], gui_keys_count[i]);
}
}
return WEECHAT_RC_OK;
}
/* display redefined or key bindings added */
if (string_strcasecmp (argv[1], "listdiff") == 0)
{
command_key_display_listdiff ();
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
if ((argc < 3)
|| (string_strcasecmp (argv[2], gui_key_context_string[i]) == 0))
{
command_key_display_listdiff (i);
}
}
return WEECHAT_RC_OK;
}
/* display default key bindings */
if (string_strcasecmp (argv[1], "listdefault") == 0)
{
command_key_display_list (_("No default key binding"),
_("Default key bindings (%d):"),
gui_default_keys,
gui_default_keys_count);
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
if ((argc < 3)
|| (string_strcasecmp (argv[2], gui_key_context_string[i]) == 0))
{
command_key_display_list (_("No default key binding for "
"context \"%s\""),
_("Default key bindings (%d) for "
"context \"%s\":"),
i,
gui_default_keys[i],
gui_default_keys_count[i]);
}
}
return WEECHAT_RC_OK;
}
/* bind a key (or display binding) */
if (string_strcasecmp (argv[1], "bind") == 0)
{
COMMAND_MIN_ARGS(3, "key bind");
/* display a key binding */
if (argc == 3)
{
ptr_new_key = NULL;
internal_code = gui_keyboard_get_internal_code (argv[2]);
internal_code = gui_key_get_internal_code (argv[2]);
if (internal_code)
ptr_new_key = gui_keyboard_search (gui_keys, internal_code);
ptr_new_key = gui_key_search (gui_keys[GUI_KEY_CONTEXT_DEFAULT],
internal_code);
if (ptr_new_key)
{
gui_chat_printf (NULL, "");
@@ -2411,12 +2551,11 @@ COMMAND_CALLBACK(key)
return WEECHAT_RC_OK;
}
COMMAND_MIN_ARGS(4, "key bind");
/* bind new key */
gui_keyboard_verbose = 1;
ptr_new_key = gui_keyboard_bind (NULL, argv[2], argv_eol[3]);
gui_keyboard_verbose = 0;
gui_key_verbose = 1;
ptr_new_key = gui_key_bind (NULL, GUI_KEY_CONTEXT_DEFAULT,
argv[2], argv_eol[3]);
gui_key_verbose = 0;
if (!ptr_new_key)
{
gui_chat_printf (NULL,
@@ -2428,25 +2567,115 @@ COMMAND_CALLBACK(key)
return WEECHAT_RC_OK;
}
/* unbind a key */
if (string_strcasecmp (argv[1], "unbind") == 0)
/* bind a key for given context (or display binding) */
if (string_strcasecmp (argv[1], "bindctxt") == 0)
{
if (argc >= 3)
COMMAND_MIN_ARGS(4, "key bindctxt");
/* search context */
context = gui_key_search_context (argv[2]);
if (context < 0)
{
if (gui_keyboard_unbind (NULL, argv[2], 1))
gui_chat_printf (NULL,
_("%sError: context \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
}
/* display a key binding */
if (argc == 4)
{
ptr_new_key = NULL;
internal_code = gui_key_get_internal_code (argv[2]);
if (internal_code)
ptr_new_key = gui_key_search (gui_keys[context],
internal_code);
if (ptr_new_key)
{
gui_chat_printf (NULL,
_("Key \"%s\" unbound"),
argv[2]);
gui_chat_printf (NULL, "");
gui_chat_printf (NULL, _("Key:"));
command_key_display (ptr_new_key, NULL);
}
else
{
gui_chat_printf (NULL,
_("%sError: unable to unbind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
_("No key found"));
}
if (internal_code)
free (internal_code);
return WEECHAT_RC_OK;
}
/* bind new key */
gui_key_verbose = 1;
ptr_new_key = gui_key_bind (NULL, context,
argv[3], argv_eol[4]);
gui_key_verbose = 0;
if (!ptr_new_key)
{
gui_chat_printf (NULL,
_("%sError: unable to bind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[3]);
return WEECHAT_RC_OK;
}
return WEECHAT_RC_OK;
}
/* unbind a key */
if (string_strcasecmp (argv[1], "unbind") == 0)
{
COMMAND_MIN_ARGS(3, "key unbind");
if (gui_key_unbind (NULL, GUI_KEY_CONTEXT_DEFAULT, argv[2], 1))
{
gui_chat_printf (NULL,
_("Key \"%s\" unbound (context: \"%s\")"),
argv[2],
gui_key_context_string[GUI_KEY_CONTEXT_DEFAULT]);
}
else
{
gui_chat_printf (NULL,
_("%sError: unable to unbind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
}
return WEECHAT_RC_OK;
}
/* unbind a key for a given context */
if (string_strcasecmp (argv[1], "unbindctxt") == 0)
{
COMMAND_MIN_ARGS(4, "key unbindctxt");
/* search context */
context = gui_key_search_context (argv[2]);
if (context < 0)
{
gui_chat_printf (NULL,
_("%sError: context \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
}
if (gui_key_unbind (NULL, context, argv[3], 1))
{
gui_chat_printf (NULL,
_("Key \"%s\" unbound (context: \"%s\")"),
argv[3],
gui_key_context_string[context]);
}
else
{
gui_chat_printf (NULL,
_("%sError: unable to unbind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[3]);
return WEECHAT_RC_OK;
}
return WEECHAT_RC_OK;
}
@@ -2454,86 +2683,28 @@ COMMAND_CALLBACK(key)
/* reset a key to default binding */
if (string_strcasecmp (argv[1], "reset") == 0)
{
if (argc >= 3)
COMMAND_MIN_ARGS(3, "key reset");
return command_key_reset (GUI_KEY_CONTEXT_DEFAULT, argv[2]);
}
/* reset a key to default binding for a given context */
if (string_strcasecmp (argv[1], "resetctxt") == 0)
{
COMMAND_MIN_ARGS(4, "key reset");
/* search context */
context = gui_key_search_context (argv[2]);
if (context < 0)
{
internal_code = gui_keyboard_get_internal_code (argv[2]);
if (!internal_code)
return WEECHAT_RC_ERROR;
ptr_key = gui_keyboard_search (gui_keys, internal_code);
ptr_default_key = gui_keyboard_search (gui_default_keys, internal_code);
free (internal_code);
if (ptr_key || ptr_default_key)
{
if (ptr_key && ptr_default_key)
{
if (strcmp (ptr_key->command, ptr_default_key->command) != 0)
{
gui_keyboard_verbose = 1;
ptr_new_key = gui_keyboard_bind (NULL, argv[2],
ptr_default_key->command);
gui_keyboard_verbose = 0;
if (!ptr_new_key)
{
gui_chat_printf (NULL,
_("%sError: unable to bind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
}
}
else
{
gui_chat_printf (NULL,
_("Key \"%s\" has already default "
"value"),
argv[2]);
}
}
else if (ptr_key)
{
/* no default key, so just unbind key */
if (gui_keyboard_unbind (NULL, argv[2], 1))
{
gui_chat_printf (NULL,
_("Key \"%s\" unbound"),
argv[2]);
}
else
{
gui_chat_printf (NULL,
_("%sError: unable to unbind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
}
}
else
{
/* no key, but default key exists */
gui_keyboard_verbose = 1;
ptr_new_key = gui_keyboard_bind (NULL, argv[2],
ptr_default_key->command);
gui_keyboard_verbose = 0;
if (!ptr_new_key)
{
gui_chat_printf (NULL,
_("%sError: unable to bind key \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
}
}
}
else
{
gui_chat_printf (NULL, _("%sKey \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
}
gui_chat_printf (NULL,
_("%sError: context \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_OK;
}
return WEECHAT_RC_OK;
return command_key_reset (context, argv[3]);
}
/* reset ALL keys (only with "-yes", for security reason) */
@@ -2541,10 +2712,20 @@ COMMAND_CALLBACK(key)
{
if ((argc >= 3) && (string_strcasecmp (argv[2], "-yes") == 0))
{
gui_keyboard_free_all (&gui_keys, &last_gui_key, &gui_keys_count);
gui_keyboard_default_bindings ();
gui_chat_printf (NULL,
_("Default key bindings restored"));
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
if ((argc < 4)
|| (string_strcasecmp (argv[3], gui_key_context_string[i]) == 0))
{
gui_key_free_all (&gui_keys[i], &last_gui_key[i],
&gui_keys_count[i]);
gui_key_default_bindings (i);
gui_chat_printf (NULL,
_("Default key bindings restored for "
"context \"%s\""),
gui_key_context_string[i]);
}
}
}
else
{
@@ -2560,15 +2741,24 @@ COMMAND_CALLBACK(key)
/* add missing keys */
if (string_strcasecmp (argv[1], "missing") == 0)
{
old_keys_count = gui_keys_count;
gui_keyboard_verbose = 1;
gui_keyboard_default_bindings ();
gui_keyboard_verbose = 0;
keys_added = (gui_keys_count > old_keys_count) ?
gui_keys_count - old_keys_count : 0;
gui_chat_printf (NULL,
NG_("%d new key added", "%d new keys added", keys_added),
keys_added);
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
if ((argc < 3)
|| (string_strcasecmp (argv[2], gui_key_context_string[i]) == 0))
{
old_keys_count = gui_keys_count[i];
gui_key_verbose = 1;
gui_key_default_bindings (i);
gui_key_verbose = 0;
keys_added = (gui_keys_count[i] > old_keys_count) ?
gui_keys_count[i] - old_keys_count : 0;
gui_chat_printf (NULL,
NG_("%d new key added", "%d new keys added "
"(context: \"%s\")", keys_added),
keys_added,
gui_key_context_string[i]);
}
}
return WEECHAT_RC_OK;
}
@@ -4980,6 +5170,10 @@ command_init ()
" complete_previous: complete word with previous "
"completion\n"
" search_text: search text in buffer\n"
" search_switch_case: switch exact case for search\n"
" search_previous: search previous line\n"
" search_next: search next line\n"
" search_stop: stop search\n"
" delete_previous_char: delete previous char\n"
" delete_next_char: delete next char\n"
" delete_previous_word: delete previous word\n"
@@ -5027,6 +5221,7 @@ command_init ()
" insert: insert text in command line\n\n"
"This command is used by key bindings or plugins."),
"return|complete_next|complete_previous|search_text|"
"search_switch_case|search_previous|search_next|search_stop|"
"delete_previous_char|delete_next_char|"
"delete_previous_word|delete_next_word|"
"delete_beginning_of_line|delete_end_of_line|"
@@ -5043,21 +5238,33 @@ command_init ()
&command_input, NULL);
hook_command (NULL, "key",
N_("bind/unbind keys"),
N_("list|listdefault|listdiff"
N_("list|listdefault|listdiff [<context>]"
" || bind <key> [<command> [<args>]]"
" || bindctxt <context> <key> [<command> [<args>]]"
" || unbind <key>"
" || unbindctxt <context> <key>"
" || reset <key>"
" || resetall -yes"
" || missing"),
" || resetctxt <context> <key>"
" || resetall -yes [<context>]"
" || missing [<context>]"),
N_(" list: list all current keys (without argument, "
"this list is displayed)\n"
"listdefault: list default keys\n"
" listdiff: list differences between current and "
"default keys (keys added, redefined or deleted)\n"
"default keys (keys added, redefined or deleted)\n"
" context: name of context (\"default\" or "
"\"search\")\n"
" bind: bind a command to a key or display command "
"bound to key\n"
" unbind: remove a key binding\n"
" reset: reset a key to default binding\n"
"bound to key (for context \"default\")\n"
" bindctxt: bind a command to a key or display command "
"bound to key, for given context\n"
" unbind: remove a key binding (for context "
"\"default\")\n"
" unbindctxt: remove a key binding for given context\n"
" reset: reset a key to default binding (for "
"context \"default\")\n"
" resetctxt: reset a key to default binding, for given "
"context\n"
" resetall: restore bindings to the default values and "
"delete ALL personal bindings (use carefully!)\n"
" missing: add missing keys (using default bindings), "
@@ -5071,15 +5278,20 @@ command_init ()
" key alt-r to jump to #weechat IRC channel:\n"
" /key bind meta-r /buffer #weechat\n"
" restore default binding for key alt-r:\n"
" /key reset meta-r"),
"list"
" || listdefault"
" || listdiff"
" /key reset meta-r\n"
" key \"tab\" to stop search in buffer:\n"
" /key bindctxt search ctrl-I /input search_stop"),
"list %(keys_contexts)"
" || listdefault %(keys_contexts)"
" || listdiff %(keys_contexts)"
" || bind %(keys_codes) %(commands)"
" || bindctxt %(keys_contexts) %(keys_codes) %(commands)"
" || unbind %(keys_codes)"
" || unbindctxt %(keys_contexts) %(keys_codes)"
" || reset %(keys_codes_for_reset)"
" || resetctxt %(keys_contexts) %(keys_codes_for_reset)"
" || resetall"
" || missing",
" || missing %(keys_contexts)",
&command_key, NULL);
hook_command (NULL, "layout",
N_("save/apply/reset layout for buffers and windows"),
+75 -35
View File
@@ -48,7 +48,7 @@
#include "../gui/gui-buffer.h"
#include "../gui/gui-color.h"
#include "../gui/gui-filter.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-key.h"
#include "../gui/gui-nicklist.h"
@@ -1105,6 +1105,32 @@ completion_list_add_proxies_options_cb (void *data,
return WEECHAT_RC_OK;
}
/*
* completion_list_add_keys_contexts_cb: add keys contexts to completion list
*/
int
completion_list_add_keys_contexts_cb (void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
/* make C compiler happy */
(void) data;
(void) completion_item;
(void) buffer;
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
gui_completion_list_add (completion, gui_key_context_string[i],
0, WEECHAT_LIST_POS_END);
}
return WEECHAT_RC_OK;
}
/*
* completion_list_add_keys_codes_cb: add keys to completion list
*/
@@ -1115,6 +1141,7 @@ completion_list_add_keys_codes_cb (void *data,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
struct t_gui_key *ptr_key;
char *expanded_name;
@@ -1122,15 +1149,18 @@ completion_list_add_keys_codes_cb (void *data,
(void) data;
(void) completion_item;
(void) buffer;
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
gui_completion_list_add (completion,
(expanded_name) ? expanded_name : ptr_key->key,
0, WEECHAT_LIST_POS_SORT);
if (expanded_name)
free (expanded_name);
for (ptr_key = gui_keys[i]; ptr_key; ptr_key = ptr_key->next_key)
{
expanded_name = gui_key_get_expanded_name (ptr_key->key);
gui_completion_list_add (completion,
(expanded_name) ? expanded_name : ptr_key->key,
0, WEECHAT_LIST_POS_SORT);
if (expanded_name)
free (expanded_name);
}
}
return WEECHAT_RC_OK;
@@ -1148,6 +1178,7 @@ completion_list_add_keys_codes_for_reset_cb (void *data,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
int i;
struct t_gui_key *ptr_key, *ptr_default_key;
char *expanded_name;
@@ -1155,36 +1186,39 @@ completion_list_add_keys_codes_for_reset_cb (void *data,
(void) data;
(void) completion_item;
(void) buffer;
/* keys added or redefined */
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
ptr_default_key = gui_keyboard_search (gui_default_keys, ptr_key->key);
if (!ptr_default_key
|| (strcmp (ptr_default_key->command, ptr_key->command) != 0))
/* keys added or redefined */
for (ptr_key = gui_keys[i]; ptr_key; ptr_key = ptr_key->next_key)
{
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
gui_completion_list_add (completion,
(expanded_name) ? expanded_name : ptr_key->key,
0, WEECHAT_LIST_POS_SORT);
if (expanded_name)
free (expanded_name);
ptr_default_key = gui_key_search (gui_default_keys[i], ptr_key->key);
if (!ptr_default_key
|| (strcmp (ptr_default_key->command, ptr_key->command) != 0))
{
expanded_name = gui_key_get_expanded_name (ptr_key->key);
gui_completion_list_add (completion,
(expanded_name) ? expanded_name : ptr_key->key,
0, WEECHAT_LIST_POS_SORT);
if (expanded_name)
free (expanded_name);
}
}
}
/* keys deleted */
for (ptr_default_key = gui_default_keys; ptr_default_key;
ptr_default_key = ptr_default_key->next_key)
{
ptr_key = gui_keyboard_search (gui_keys, ptr_default_key->key);
if (!ptr_key)
/* keys deleted */
for (ptr_default_key = gui_default_keys[i]; ptr_default_key;
ptr_default_key = ptr_default_key->next_key)
{
expanded_name = gui_keyboard_get_expanded_name (ptr_default_key->key);
gui_completion_list_add (completion,
(expanded_name) ? expanded_name : ptr_default_key->key,
0, WEECHAT_LIST_POS_SORT);
if (expanded_name)
free (expanded_name);
ptr_key = gui_key_search (gui_keys[i], ptr_default_key->key);
if (!ptr_key)
{
expanded_name = gui_key_get_expanded_name (ptr_default_key->key);
gui_completion_list_add (completion,
(expanded_name) ? expanded_name : ptr_default_key->key,
0, WEECHAT_LIST_POS_SORT);
if (expanded_name)
free (expanded_name);
}
}
}
@@ -1264,10 +1298,16 @@ completion_init ()
hook_completion (NULL, "bars_options",
N_("options for bars"),
&completion_list_add_bars_options_cb, NULL);
hook_completion (NULL, "keys_contexts",
/* TRANSLATORS: "key" means "key on the keyboard" */
N_("key contexts"),
&completion_list_add_keys_contexts_cb, NULL);
hook_completion (NULL, "keys_codes",
/* TRANSLATORS: "key" means "key on the keyboard" */
N_("key codes"),
&completion_list_add_keys_codes_cb, NULL);
hook_completion (NULL, "keys_codes_for_reset",
/* TRANSLATORS: "key" means "key on the keyboard" */
N_("key codes that can be reset (keys added, redefined "
"or removed)"),
&completion_list_add_keys_codes_for_reset_cb, NULL);
+59 -22
View File
@@ -52,7 +52,7 @@
#include "../gui/gui-color.h"
#include "../gui/gui-filter.h"
#include "../gui/gui-hotlist.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-key.h"
#include "../gui/gui-layout.h"
#include "../gui/gui-line.h"
#include "../gui/gui-main.h"
@@ -581,6 +581,8 @@ config_day_change_timer_cb (void *data, int remaining_calls)
void
config_weechat_init_after_read ()
{
int i;
gui_buffer_notify_set_all ();
proxy_use_temp_proxies ();
@@ -601,8 +603,11 @@ config_weechat_init_after_read ()
}
/* if no key was found config file, then we use default bindings */
if (!gui_keys)
gui_keyboard_default_bindings ();
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
if (!gui_keys[i])
gui_key_default_bindings (i);
}
}
/*
@@ -616,13 +621,17 @@ config_weechat_init_after_read ()
int
config_weechat_reload_cb (void *data, struct t_config_file *config_file)
{
int rc;
int i, rc;
/* make C compiler happy */
(void) data;
/* remove all keys */
gui_keyboard_free_all (&gui_keys, &last_gui_key, &gui_keys_count);
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
gui_key_free_all (&gui_keys[i], &last_gui_key[i],
&gui_keys_count[i]);
}
/* remove all proxies */
proxy_free_all ();
@@ -1425,22 +1434,33 @@ config_weechat_key_read_cb (void *data, struct t_config_file *config_file,
struct t_config_section *section,
const char *option_name, const char *value)
{
int context;
char *pos;
/* make C compiler happy */
(void) data;
(void) config_file;
(void) section;
if (option_name)
{
context = GUI_KEY_CONTEXT_DEFAULT;
pos = strchr (section->name, '_');
if (pos)
{
context = gui_key_search_context (pos + 1);
if (context < 0)
context = GUI_KEY_CONTEXT_DEFAULT;
}
if (value && value[0])
{
/* bind key (overwrite any binding with same key) */
gui_keyboard_bind (NULL, option_name, value);
gui_key_bind (NULL, context, option_name, value);
}
else
{
/* unbind key if no value given */
gui_keyboard_unbind (NULL, option_name, 1);
gui_key_unbind (NULL, context, option_name, 1);
}
}
@@ -1456,18 +1476,26 @@ config_weechat_key_write_cb (void *data, struct t_config_file *config_file,
const char *section_name)
{
struct t_gui_key *ptr_key;
char *expanded_name;
int rc;
char *pos, *expanded_name;
int rc, context;
/* make C compiler happy */
(void) data;
if (!config_file_write_line (config_file, section_name, NULL))
return WEECHAT_CONFIG_WRITE_ERROR;
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
context = GUI_KEY_CONTEXT_DEFAULT;
pos = strchr (section_name, '_');
if (pos)
{
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
context = gui_key_search_context (pos + 1);
if (context < 0)
context = GUI_KEY_CONTEXT_DEFAULT;
}
for (ptr_key = gui_keys[context]; ptr_key; ptr_key = ptr_key->next_key)
{
expanded_name = gui_key_get_expanded_name (ptr_key->key);
if (expanded_name)
{
rc = config_file_write_line (config_file,
@@ -1493,6 +1521,8 @@ int
config_weechat_init_options ()
{
struct t_config_section *ptr_section;
int i;
char section_name[128];
weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_NAME,
&config_weechat_reload_cb, NULL);
@@ -2507,16 +2537,23 @@ config_weechat_init_options ()
}
/* keys */
ptr_section = config_file_new_section (weechat_config_file, "key",
0, 0,
&config_weechat_key_read_cb, NULL,
&config_weechat_key_write_cb, NULL,
&config_weechat_key_write_cb, NULL,
NULL, NULL, NULL, NULL);
if (!ptr_section)
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
config_file_free (weechat_config_file);
return 0;
snprintf (section_name, sizeof (section_name),
"key%s%s",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : "_",
(i == GUI_KEY_CONTEXT_DEFAULT) ? "" : gui_key_context_string[i]);
ptr_section = config_file_new_section (weechat_config_file, section_name,
0, 0,
&config_weechat_key_read_cb, NULL,
&config_weechat_key_write_cb, NULL,
&config_weechat_key_write_cb, NULL,
NULL, NULL, NULL, NULL);
if (!ptr_section)
{
config_file_free (weechat_config_file);
return 0;
}
}
return 1;
+2 -2
View File
@@ -49,7 +49,7 @@
#include "../gui/gui-chat.h"
#include "../gui/gui-filter.h"
#include "../gui/gui-hotlist.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-key.h"
#include "../gui/gui-layout.h"
#include "../gui/gui-main.h"
#include "../gui/gui-window.h"
@@ -92,7 +92,7 @@ debug_dump (int crash)
gui_window_print_log ();
gui_buffer_print_log ();
gui_layout_print_log ();
gui_keyboard_print_log (NULL);
gui_key_print_log (NULL);
gui_filter_print_log ();
gui_bar_print_log ();
gui_bar_item_print_log ();
+23 -17
View File
@@ -72,7 +72,7 @@
#include "../gui/gui-completion.h"
#include "../gui/gui-layout.h"
#include "../gui/gui-main.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-key.h"
#include "../plugins/plugin.h"
@@ -164,22 +164,28 @@ weechat_display_keys ()
{
struct t_gui_key *ptr_key;
char *expanded_name;
gui_keyboard_default_bindings ();
string_iconv_fprintf (stdout,
/* TRANSLATORS: "%s" is "weechat" */
_("%s default keys:\n"),
PACKAGE_NAME);
string_iconv_fprintf (stdout, "\n");
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
int i;
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
expanded_name = gui_keyboard_get_expanded_name (ptr_key->key);
gui_key_default_bindings (i);
string_iconv_fprintf (stdout,
"* %s => %s\n",
(expanded_name) ? expanded_name : ptr_key->key,
ptr_key->command);
if (expanded_name)
free (expanded_name);
/* TRANSLATORS: first "%s" is "weechat" */
_("%s default keys (context: \"%s\"):\n"),
(gui_key_context_string[i] && gui_key_context_string[i][0]) ?
_(gui_key_context_string[i]) : "",
PACKAGE_NAME);
string_iconv_fprintf (stdout, "\n");
for (ptr_key = gui_keys[i]; ptr_key; ptr_key = ptr_key->next_key)
{
expanded_name = gui_key_get_expanded_name (ptr_key->key);
string_iconv_fprintf (stdout,
"* %s => %s\n",
(expanded_name) ? expanded_name : ptr_key->key,
ptr_key->command);
if (expanded_name)
free (expanded_name);
}
}
}
@@ -418,7 +424,7 @@ main (int argc, char *argv[])
gui_main_pre_init (&argc, &argv); /* pre-initiliaze interface */
command_init (); /* initialize WeeChat commands */
completion_init (); /* add core completion hooks */
gui_keyboard_init (); /* init keyboard */
gui_key_init (); /* init keys */
if (!config_weechat_init ()) /* init options with default values */
exit (EXIT_FAILURE);
weechat_parse_args (argc, argv); /* parse command line args */
@@ -451,7 +457,7 @@ main (int argc, char *argv[])
gui_main_end (1); /* shut down WeeChat GUI */
proxy_free_all (); /* free all proxies */
config_file_free_all (); /* free all configuration files */
gui_keyboard_end (); /* end keyboard */
gui_key_end (); /* remove all keys */
unhook_all (); /* remove all hooks */
hdata_end (); /* end hdata */
weechat_shutdown (EXIT_SUCCESS, 0); /* quit WeeChat (oh no, why?) */
+1 -1
View File
@@ -29,7 +29,7 @@ gui-completion.c gui-completion.h
gui-history.c gui-history.h
gui-hotlist.c gui-hotlist.h
gui-input.c gui-input.h
gui-keyboard.c gui-keyboard.h
gui-key.c gui-key.h
gui-layout.c gui-layout.h
gui-line.c gui-line.h
gui-main.h
+2 -2
View File
@@ -43,8 +43,8 @@ lib_weechat_gui_common_a_SOURCES = gui-bar.c \
gui-hotlist.h \
gui-input.c \
gui-input.h \
gui-keyboard.c \
gui-keyboard.h \
gui-key.c \
gui-key.h \
gui-layout.c \
gui-layout.h \
gui-line.c \
+1 -1
View File
@@ -28,7 +28,7 @@ gui-curses.h
gui-curses-bar-window.c
gui-curses-chat.c
gui-curses-color.c
gui-curses-keyboard.c
gui-curses-key.c
gui-curses-main.c
gui-curses-term.c
gui-curses-window.c)
+1 -1
View File
@@ -35,7 +35,7 @@ weechat_curses_LDADD = ./../../core/lib_weechat_core.a \
weechat_curses_SOURCES = gui-curses-bar-window.c \
gui-curses-chat.c \
gui-curses-color.c \
gui-curses-keyboard.c \
gui-curses-key.c \
gui-curses-main.c \
gui-curses-term.c \
gui-curses-window.c \
+508
View File
@@ -0,0 +1,508 @@
/*
* Copyright (C) 2003-2011 Sebastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* gui-curses-key.c: keyboard functions for Curses GUI
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
#include "../../core/wee-hook.h"
#include "../../core/wee-log.h"
#include "../../core/wee-utf8.h"
#include "../../core/wee-string.h"
#include "../../plugins/plugin.h"
#include "../gui-key.h"
#include "../gui-buffer.h"
#include "../gui-color.h"
#include "../gui-input.h"
#include "../gui-completion.h"
#include "../gui-window.h"
#include "gui-curses.h"
#define BIND(key, command) gui_key_default_bind(context, key, command)
/*
* gui_key_default_bind: create key bind, only if it does not exist yet
*/
void
gui_key_default_bind (int context, const char *key, const char *command)
{
struct t_gui_key *ptr_key;
char *internal_code;
internal_code = gui_key_get_internal_code (key);
ptr_key = gui_key_search (gui_keys[context],
(internal_code) ? internal_code : key);
if (!ptr_key)
gui_key_new (NULL, context, key, command);
if (internal_code)
free (internal_code);
}
/*
* gui_key_default_bindings: create default key bindings for context given
*/
void
gui_key_default_bindings (int context)
{
int i;
char key_str[32], command[32];
switch (context)
{
case GUI_KEY_CONTEXT_DEFAULT:
BIND(/* RC */ "ctrl-M", "/input return");
BIND(/* RC */ "ctrl-J", "/input return");
BIND(/* tab */ "ctrl-I", "/input complete_next");
BIND(/* s-tab */ "meta2-Z", "/input complete_previous");
BIND(/* ^R */ "ctrl-R", "/input search_text");
BIND(/* basckpace */ "ctrl-H", "/input delete_previous_char");
BIND(/* basckpace */ "ctrl-?", "/input delete_previous_char");
BIND(/* ^_ */ "ctrl-_", "/input undo");
BIND(/* m-_ */ "meta-_", "/input redo");
BIND(/* del */ "meta2-3~", "/input delete_next_char");
BIND(/* ^D */ "ctrl-D", "/input delete_next_char");
BIND(/* ^W */ "ctrl-W", "/input delete_previous_word");
BIND(/* ^X */ "ctrl-X", "/input switch_active_buffer");
BIND(/* m-d */ "meta-d", "/input delete_next_word");
BIND(/* ^K */ "ctrl-K", "/input delete_end_of_line");
BIND(/* m-r */ "meta-r", "/input delete_line");
BIND(/* ^T */ "ctrl-T", "/input transpose_chars");
BIND(/* ^U */ "ctrl-U", "/input delete_beginning_of_line");
BIND(/* ^Y */ "ctrl-Y", "/input clipboard_paste");
BIND(/* home */ "meta2-1~", "/input move_beginning_of_line");
BIND(/* home */ "meta2-H", "/input move_beginning_of_line");
BIND(/* home */ "meta2-7~", "/input move_beginning_of_line");
BIND(/* home */ "meta-OH", "/input move_beginning_of_line");
BIND(/* ^A */ "ctrl-A", "/input move_beginning_of_line");
BIND(/* end */ "meta2-4~", "/input move_end_of_line");
BIND(/* end */ "meta2-F", "/input move_end_of_line");
BIND(/* end */ "meta2-8~", "/input move_end_of_line");
BIND(/* end */ "meta-OF", "/input move_end_of_line");
BIND(/* ^E */ "ctrl-E", "/input move_end_of_line");
BIND(/* left */ "meta2-D", "/input move_previous_char");
BIND(/* ^B */ "ctrl-B", "/input move_previous_char");
BIND(/* right */ "meta2-C", "/input move_next_char");
BIND(/* ^F */ "ctrl-F", "/input move_next_char");
BIND(/* m-b */ "meta-b", "/input move_previous_word");
BIND(/* ^left */ "meta-Od", "/input move_previous_word");
BIND(/* ^left */ "meta-OD", "/input move_previous_word");
BIND(/* m-f */ "meta-f", "/input move_next_word");
BIND(/* ^right */ "meta-Oc", "/input move_next_word");
BIND(/* ^right */ "meta-OC", "/input move_next_word");
BIND(/* up */ "meta2-A", "/input history_previous");
BIND(/* down */ "meta2-B", "/input history_next");
BIND(/* ^up */ "meta-Oa", "/input history_global_previous");
BIND(/* ^up */ "meta-OA", "/input history_global_previous");
BIND(/* ^up */ "meta2-1;5A", "/input history_global_previous");
BIND(/* ^down */ "meta-Ob", "/input history_global_next");
BIND(/* ^down */ "meta-OB", "/input history_global_next");
BIND(/* ^down */ "meta2-1;5B", "/input history_global_next");
BIND(/* m-a */ "meta-a", "/input jump_smart");
BIND(/* m-j,m-l */ "meta-jmeta-l", "/input jump_last_buffer");
BIND(/* m-j,m-r */ "meta-jmeta-r", "/server raw");
BIND(/* m-j,m-s */ "meta-jmeta-s", "/server jump");
BIND(/* m-h */ "meta-h", "/input hotlist_clear");
BIND(/* m-k */ "meta-k", "/input grab_key_command");
BIND(/* m-u */ "meta-u", "/input scroll_unread");
BIND(/* ^S^U */ "ctrl-Sctrl-U", "/input set_unread");
BIND(/* ^Cb */ "ctrl-Cb", "/input insert \\x02");
BIND(/* ^Cc */ "ctrl-Cc", "/input insert \\x03");
BIND(/* ^Ci */ "ctrl-Ci", "/input insert \\x1D");
BIND(/* ^Co */ "ctrl-Co", "/input insert \\x0F");
BIND(/* ^Cr */ "ctrl-Cr", "/input insert \\x12");
BIND(/* ^Cu */ "ctrl-Cu", "/input insert \\x15");
BIND(/* m-right */ "meta-meta2-C", "/buffer +1");
BIND(/* m-right */ "meta2-1;3C", "/buffer +1");
BIND(/* m-down */ "meta-meta2-B", "/buffer +1");
BIND(/* m-down */ "meta2-1;3B", "/buffer +1");
BIND(/* F6 */ "meta2-17~", "/buffer +1");
BIND(/* ^N */ "ctrl-N", "/buffer +1");
BIND(/* m-left */ "meta-meta2-D", "/buffer -1");
BIND(/* m-left */ "meta2-1;3D", "/buffer -1");
BIND(/* m-up */ "meta-meta2-A", "/buffer -1");
BIND(/* m-up */ "meta2-1;3A", "/buffer -1");
BIND(/* F5 */ "meta2-15~", "/buffer -1");
BIND(/* ^P */ "ctrl-P", "/buffer -1");
BIND(/* pgup */ "meta2-5~", "/window page_up");
BIND(/* pgup */ "meta2-I", "/window page_up");
BIND(/* pgdn */ "meta2-6~", "/window page_down");
BIND(/* pgdn */ "meta2-G", "/window page_down");
BIND(/* m-pgup */ "meta-meta2-5~", "/window scroll_up");
BIND(/* m-pgup */ "meta2-5;3~", "/window scroll_up");
BIND(/* m-pgdn */ "meta-meta2-6~", "/window scroll_down");
BIND(/* m-pgdn */ "meta2-6;3~", "/window scroll_down");
BIND(/* m-home */ "meta-meta2-1~", "/window scroll_top");
BIND(/* m-home */ "meta-meta2-7~", "/window scroll_top");
BIND(/* m-end */ "meta-meta2-4~", "/window scroll_bottom");
BIND(/* m-end */ "meta-meta2-8~", "/window scroll_bottom");
BIND(/* m-n */ "meta-n", "/window scroll_next_highlight");
BIND(/* m-p */ "meta-p", "/window scroll_previous_highlight");
BIND(/* F9 */ "meta2-20~", "/bar scroll title * x-50%");
BIND(/* F10 */ "meta2-21~", "/bar scroll title * x+50%");
BIND(/* F11 */ "meta2-23~", "/bar scroll nicklist * y-100%");
BIND(/* F12 */ "meta2-24~", "/bar scroll nicklist * y+100%");
BIND(/* m-F11 */ "meta-meta2-23~", "/bar scroll nicklist * yb");
BIND(/* m-F12 */ "meta-meta2-24~", "/bar scroll nicklist * ye");
BIND(/* ^L */ "ctrl-L", "/window refresh");
BIND(/* F7 */ "meta2-18~", "/window -1");
BIND(/* F8 */ "meta2-19~", "/window +1");
BIND(/* m-w,m-up */ "meta-wmeta-meta2-A", "/window up");
BIND(/* m-w,m-up */ "meta-wmeta2-1;3A", "/window up");
BIND(/* m-w,m-down */ "meta-wmeta-meta2-B", "/window down");
BIND(/* m-w,m-down */ "meta-wmeta2-1;3B", "/window down");
BIND(/* m-w,m-right */ "meta-wmeta-meta2-C", "/window right");
BIND(/* m-w,m-right */ "meta-wmeta2-1;3C", "/window right");
BIND(/* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
BIND(/* m-w,m-left */ "meta-wmeta2-1;3D", "/window left");
BIND(/* m-w,m-b */ "meta-wmeta-b", "/window balance");
BIND(/* m-w,m-s */ "meta-wmeta-s", "/window swap");
BIND(/* m-z */ "meta-z", "/window zoom");
BIND(/* m-= */ "meta-=", "/filter toggle");
BIND(/* m-0 */ "meta-0", "/buffer *10");
BIND(/* m-1 */ "meta-1", "/buffer *1");
BIND(/* m-2 */ "meta-2", "/buffer *2");
BIND(/* m-3 */ "meta-3", "/buffer *3");
BIND(/* m-4 */ "meta-4", "/buffer *4");
BIND(/* m-5 */ "meta-5", "/buffer *5");
BIND(/* m-6 */ "meta-6", "/buffer *6");
BIND(/* m-7 */ "meta-7", "/buffer *7");
BIND(/* m-8 */ "meta-8", "/buffer *8");
BIND(/* m-9 */ "meta-9", "/buffer *9");
BIND(/* m-< */ "meta-<", "/input jump_previously_visited_buffer");
BIND(/* m-> */ "meta->", "/input jump_next_visited_buffer");
/* bind meta-j + {01..99} to switch to buffers # > 10 */
for (i = 1; i < 100; i++)
{
sprintf (key_str, "meta-j%02d", i);
sprintf (command, "/buffer %d", i);
BIND(key_str, command);
}
break;
case GUI_KEY_CONTEXT_SEARCH:
BIND(/* RC */ "ctrl-M", "/input search_stop");
BIND(/* RC */ "ctrl-J", "/input search_stop");
BIND(/* ^R */ "ctrl-R", "/input search_switch_case");
BIND(/* up */ "meta2-A", "/input search_previous");
BIND(/* down */ "meta2-B", "/input search_next");
break;
}
}
/*
* gui_key_flush: flush keyboard buffer
*/
void
gui_key_flush ()
{
int i, key, insert_ok;
char key_str[32], *key_utf, *input_old;
/*
* if there's no paste pending, then we use buffer and do actions
* according to keys
*/
if (!gui_key_paste_pending)
{
if (gui_key_buffer_size > 0)
gui_key_last_activity_time = time (NULL);
for (i = 0; i < gui_key_buffer_size; i++)
{
key = gui_key_buffer[i];
insert_ok = 1;
if (key < 32)
{
insert_ok = 0;
key_str[0] = '^';
key_str[1] = (char) key + '@';
key_str[2] = '\0';
}
else if (key == 127)
{
key_str[0] = '^';
key_str[1] = '?';
key_str[2] = '\0';
}
else
{
if (local_utf8)
{
/* 1 char: 0vvvvvvv */
if (key < 0x80)
{
key_str[0] = (char) key;
key_str[1] = '\0';
}
/* 2 chars: 110vvvvv 10vvvvvv */
else if ((key & 0xE0) == 0xC0)
{
key_str[0] = (char) key;
if (i < gui_key_buffer_size - 1)
{
key_str[1] = (char) (gui_key_buffer[++i]);
key_str[2] = '\0';
}
else
key_str[1] = '\0';
}
/* 3 chars: 1110vvvv 10vvvvvv 10vvvvvv */
else if ((key & 0xF0) == 0xE0)
{
key_str[0] = (char) key;
if (i < gui_key_buffer_size - 1)
{
key_str[1] = (char) (gui_key_buffer[++i]);
if (i < gui_key_buffer_size - 1)
{
key_str[2] = (char) (gui_key_buffer[++i]);
key_str[3] = '\0';
}
else
key_str[2] = '\0';
}
else
key_str[1] = '\0';
}
/* 4 chars: 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv */
else if ((key & 0xF8) == 0xF0)
{
key_str[0] = (char) key;
if (i < gui_key_buffer_size - 1)
{
key_str[1] = (char) (gui_key_buffer[++i]);
if (i < gui_key_buffer_size - 1)
{
key_str[2] = (char) (gui_key_buffer[++i]);
if (i < gui_key_buffer_size - 1)
{
key_str[3] = (char) (gui_key_buffer[++i]);
key_str[4] = '\0';
}
else
key_str[3] = '\0';
}
else
key_str[2] = '\0';
}
else
key_str[1] = '\0';
}
}
else
{
key_str[0] = (char) key;
key_str[1] = '\0';
/* convert input to UTF-8 is user is not using UTF-8 as locale */
if (!local_utf8)
{
key_utf = string_iconv_to_internal (NULL, key_str);
strncpy (key_str, key_utf, sizeof (key_str));
key_str[sizeof (key_str) - 1] = '\0';
}
}
}
if (strcmp (key_str, "^") == 0)
{
key_str[1] = '^';
key_str[2] = '\0';
}
hook_signal_send ("key_pressed",
WEECHAT_HOOK_SIGNAL_STRING, key_str);
if (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
input_old = (gui_current_window->buffer->input_buffer) ?
strdup (gui_current_window->buffer->input_buffer) : strdup ("");
else
input_old = NULL;
if ((gui_key_pressed (key_str) != 0) && (insert_ok))
{
if (strcmp (key_str, "^^") == 0)
key_str[1] = '\0';
gui_buffer_undo_snap (gui_current_window->buffer);
gui_input_insert_string (gui_current_window->buffer,
key_str, -1);
if (gui_current_window->buffer->completion)
gui_completion_stop (gui_current_window->buffer->completion, 0);
gui_input_text_changed_modifier_and_signal (gui_current_window->buffer, 1);
}
/* incremental text search in buffer */
if ((gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
&& ((input_old == NULL)
|| (gui_current_window->buffer->input_buffer == NULL)
|| (strcmp (input_old, gui_current_window->buffer->input_buffer) != 0)))
{
/*
* if current input is longer than old input, and that
* beginning of current input is exactly equal to old input,
* then do nothing (search will not find any result and can
* take some time on buffer with many lines..)
*/
if (!gui_current_window->buffer->text_search_found
&& (input_old != NULL)
&& (input_old[0])
&& (gui_current_window->buffer->input_buffer != NULL)
&& (gui_current_window->buffer->input_buffer[0])
&& (strlen (gui_current_window->buffer->input_buffer) > strlen (input_old))
&& (strncmp (gui_current_window->buffer->input_buffer, input_old,
strlen (input_old)) == 0))
{
/*
* do not search text in buffer, just alert about text not
* found
*/
if (CONFIG_BOOLEAN(config_look_search_text_not_found_alert))
printf ("\a");
}
else
{
gui_window_search_restart (gui_current_window);
}
}
if (input_old)
free (input_old);
}
if (gui_key_grab && (gui_key_grab_count > 0))
gui_key_grab_end ();
gui_key_buffer_reset ();
}
}
/*
* gui_key_read_cb: read keyboard chars
*/
int
gui_key_read_cb (void *data, int fd)
{
int ret, i, accept_paste, cancel_paste, text_added_to_buffer, paste_lines;
unsigned char buffer[4096];
/* make C compiler happy */
(void) data;
(void) fd;
accept_paste = 0;
cancel_paste = 0;
text_added_to_buffer = 0;
if (gui_key_paste_pending)
{
ret = read (STDIN_FILENO, buffer, 1);
if (ret == 0)
{
/* no data on stdin, terminal lost */
log_printf (_("Terminal lost, exiting WeeChat..."));
hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
weechat_quit = 1;
return WEECHAT_RC_OK;
}
if (ret <= 0)
return WEECHAT_RC_OK;
/* ctrl-Y: accept paste */
if (buffer[0] == 25)
accept_paste = 1;
/* ctrl-N: cancel paste */
if (buffer[0] == 14)
cancel_paste = 1;
}
else
{
ret = read (STDIN_FILENO, buffer, sizeof (buffer));
if (ret == 0)
{
/* no data on stdin, terminal lost */
log_printf (_("Terminal lost, exiting WeeChat..."));
hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
weechat_quit = 1;
return WEECHAT_RC_OK;
}
if (ret < 0)
return WEECHAT_RC_OK;
for (i = 0; i < ret; i++)
{
gui_key_buffer_add (buffer[i]);
}
text_added_to_buffer = 1;
}
if (gui_key_paste_pending)
{
/* user is ok for pasting text, let's paste! */
if (accept_paste)
gui_key_paste_accept ();
/* user doesn't want to paste text: clear whole buffer! */
else if (cancel_paste)
gui_key_paste_cancel ();
else if (text_added_to_buffer)
gui_input_text_changed_modifier_and_signal (gui_current_window->buffer, 0);
}
else
{
/*
* detect user paste or large amount of text
* if so, ask user what to do
*/
if (CONFIG_INTEGER(config_look_paste_max_lines) > 0)
{
paste_lines = gui_key_get_paste_lines ();
if (paste_lines > CONFIG_INTEGER(config_look_paste_max_lines))
{
gui_key_paste_pending = 1;
gui_input_paste_pending_signal ();
}
}
}
gui_key_flush ();
return WEECHAT_RC_OK;
}
-501
View File
@@ -1,501 +0,0 @@
/*
* Copyright (C) 2003-2011 Sebastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* gui-curses-keyboard.c: keyboard functions for Curses GUI
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
#include "../../core/wee-hook.h"
#include "../../core/wee-log.h"
#include "../../core/wee-utf8.h"
#include "../../core/wee-string.h"
#include "../../plugins/plugin.h"
#include "../gui-keyboard.h"
#include "../gui-buffer.h"
#include "../gui-color.h"
#include "../gui-input.h"
#include "../gui-completion.h"
#include "../gui-window.h"
#include "gui-curses.h"
#define BIND(key, command) gui_keyboard_default_bind(key, command)
/*
* gui_keyboard_default_bind: create key bind, only if it does not exist yet
*/
void
gui_keyboard_default_bind (const char *key, const char *command)
{
struct t_gui_key *ptr_key;
char *internal_code;
internal_code = gui_keyboard_get_internal_code (key);
ptr_key = gui_keyboard_search (gui_keys,
(internal_code) ? internal_code : key);
if (!ptr_key)
{
gui_keyboard_new (NULL, key, command);
}
if (internal_code)
free (internal_code);
}
/*
* gui_keyboard_default_bindings: create default key bindings
*/
void
gui_keyboard_default_bindings ()
{
int i;
char key_str[32], command[32];
BIND(/* RC */ "ctrl-M", "/input return");
BIND(/* RC */ "ctrl-J", "/input return");
BIND(/* tab */ "ctrl-I", "/input complete_next");
BIND(/* s-tab */ "meta2-Z", "/input complete_previous");
BIND(/* ^R */ "ctrl-R", "/input search_text");
BIND(/* basckpace */ "ctrl-H", "/input delete_previous_char");
BIND(/* basckpace */ "ctrl-?", "/input delete_previous_char");
BIND(/* ^_ */ "ctrl-_", "/input undo");
BIND(/* m-_ */ "meta-_", "/input redo");
BIND(/* del */ "meta2-3~", "/input delete_next_char");
BIND(/* ^D */ "ctrl-D", "/input delete_next_char");
BIND(/* ^W */ "ctrl-W", "/input delete_previous_word");
BIND(/* ^X */ "ctrl-X", "/input switch_active_buffer");
BIND(/* m-d */ "meta-d", "/input delete_next_word");
BIND(/* ^K */ "ctrl-K", "/input delete_end_of_line");
BIND(/* m-r */ "meta-r", "/input delete_line");
BIND(/* ^T */ "ctrl-T", "/input transpose_chars");
BIND(/* ^U */ "ctrl-U", "/input delete_beginning_of_line");
BIND(/* ^Y */ "ctrl-Y", "/input clipboard_paste");
BIND(/* home */ "meta2-1~", "/input move_beginning_of_line");
BIND(/* home */ "meta2-H", "/input move_beginning_of_line");
BIND(/* home */ "meta2-7~", "/input move_beginning_of_line");
BIND(/* home */ "meta-OH", "/input move_beginning_of_line");
BIND(/* ^A */ "ctrl-A", "/input move_beginning_of_line");
BIND(/* end */ "meta2-4~", "/input move_end_of_line");
BIND(/* end */ "meta2-F", "/input move_end_of_line");
BIND(/* end */ "meta2-8~", "/input move_end_of_line");
BIND(/* end */ "meta-OF", "/input move_end_of_line");
BIND(/* ^E */ "ctrl-E", "/input move_end_of_line");
BIND(/* left */ "meta2-D", "/input move_previous_char");
BIND(/* ^B */ "ctrl-B", "/input move_previous_char");
BIND(/* right */ "meta2-C", "/input move_next_char");
BIND(/* ^F */ "ctrl-F", "/input move_next_char");
BIND(/* m-b */ "meta-b", "/input move_previous_word");
BIND(/* ^left */ "meta-Od", "/input move_previous_word");
BIND(/* ^left */ "meta-OD", "/input move_previous_word");
BIND(/* m-f */ "meta-f", "/input move_next_word");
BIND(/* ^right */ "meta-Oc", "/input move_next_word");
BIND(/* ^right */ "meta-OC", "/input move_next_word");
BIND(/* up */ "meta2-A", "/input history_previous");
BIND(/* down */ "meta2-B", "/input history_next");
BIND(/* ^up */ "meta-Oa", "/input history_global_previous");
BIND(/* ^up */ "meta-OA", "/input history_global_previous");
BIND(/* ^up */ "meta2-1;5A", "/input history_global_previous");
BIND(/* ^down */ "meta-Ob", "/input history_global_next");
BIND(/* ^down */ "meta-OB", "/input history_global_next");
BIND(/* ^down */ "meta2-1;5B", "/input history_global_next");
BIND(/* m-a */ "meta-a", "/input jump_smart");
BIND(/* m-j,m-l */ "meta-jmeta-l", "/input jump_last_buffer");
BIND(/* m-j,m-r */ "meta-jmeta-r", "/server raw");
BIND(/* m-j,m-s */ "meta-jmeta-s", "/server jump");
BIND(/* m-h */ "meta-h", "/input hotlist_clear");
BIND(/* m-k */ "meta-k", "/input grab_key_command");
BIND(/* m-u */ "meta-u", "/input scroll_unread");
BIND(/* ^S^U */ "ctrl-Sctrl-U", "/input set_unread");
BIND(/* ^Cb */ "ctrl-Cb", "/input insert \\x02");
BIND(/* ^Cc */ "ctrl-Cc", "/input insert \\x03");
BIND(/* ^Ci */ "ctrl-Ci", "/input insert \\x1D");
BIND(/* ^Co */ "ctrl-Co", "/input insert \\x0F");
BIND(/* ^Cr */ "ctrl-Cr", "/input insert \\x12");
BIND(/* ^Cu */ "ctrl-Cu", "/input insert \\x15");
BIND(/* m-right */ "meta-meta2-C", "/buffer +1");
BIND(/* m-right */ "meta2-1;3C", "/buffer +1");
BIND(/* m-down */ "meta-meta2-B", "/buffer +1");
BIND(/* m-down */ "meta2-1;3B", "/buffer +1");
BIND(/* F6 */ "meta2-17~", "/buffer +1");
BIND(/* ^N */ "ctrl-N", "/buffer +1");
BIND(/* m-left */ "meta-meta2-D", "/buffer -1");
BIND(/* m-left */ "meta2-1;3D", "/buffer -1");
BIND(/* m-up */ "meta-meta2-A", "/buffer -1");
BIND(/* m-up */ "meta2-1;3A", "/buffer -1");
BIND(/* F5 */ "meta2-15~", "/buffer -1");
BIND(/* ^P */ "ctrl-P", "/buffer -1");
BIND(/* pgup */ "meta2-5~", "/window page_up");
BIND(/* pgup */ "meta2-I", "/window page_up");
BIND(/* pgdn */ "meta2-6~", "/window page_down");
BIND(/* pgdn */ "meta2-G", "/window page_down");
BIND(/* m-pgup */ "meta-meta2-5~", "/window scroll_up");
BIND(/* m-pgup */ "meta2-5;3~", "/window scroll_up");
BIND(/* m-pgdn */ "meta-meta2-6~", "/window scroll_down");
BIND(/* m-pgdn */ "meta2-6;3~", "/window scroll_down");
BIND(/* m-home */ "meta-meta2-1~", "/window scroll_top");
BIND(/* m-home */ "meta-meta2-7~", "/window scroll_top");
BIND(/* m-end */ "meta-meta2-4~", "/window scroll_bottom");
BIND(/* m-end */ "meta-meta2-8~", "/window scroll_bottom");
BIND(/* m-n */ "meta-n", "/window scroll_next_highlight");
BIND(/* m-p */ "meta-p", "/window scroll_previous_highlight");
BIND(/* F9 */ "meta2-20~", "/bar scroll title * x-50%");
BIND(/* F10 */ "meta2-21~", "/bar scroll title * x+50%");
BIND(/* F11 */ "meta2-23~", "/bar scroll nicklist * y-100%");
BIND(/* F12 */ "meta2-24~", "/bar scroll nicklist * y+100%");
BIND(/* m-F11 */ "meta-meta2-23~", "/bar scroll nicklist * yb");
BIND(/* m-F12 */ "meta-meta2-24~", "/bar scroll nicklist * ye");
BIND(/* ^L */ "ctrl-L", "/window refresh");
BIND(/* F7 */ "meta2-18~", "/window -1");
BIND(/* F8 */ "meta2-19~", "/window +1");
BIND(/* m-w,m-up */ "meta-wmeta-meta2-A", "/window up");
BIND(/* m-w,m-up */ "meta-wmeta2-1;3A", "/window up");
BIND(/* m-w,m-down */ "meta-wmeta-meta2-B", "/window down");
BIND(/* m-w,m-down */ "meta-wmeta2-1;3B", "/window down");
BIND(/* m-w,m-right */ "meta-wmeta-meta2-C", "/window right");
BIND(/* m-w,m-right */ "meta-wmeta2-1;3C", "/window right");
BIND(/* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
BIND(/* m-w,m-left */ "meta-wmeta2-1;3D", "/window left");
BIND(/* m-w,m-b */ "meta-wmeta-b", "/window balance");
BIND(/* m-w,m-s */ "meta-wmeta-s", "/window swap");
BIND(/* m-z */ "meta-z", "/window zoom");
BIND(/* m-= */ "meta-=", "/filter toggle");
BIND(/* m-0 */ "meta-0", "/buffer *10");
BIND(/* m-1 */ "meta-1", "/buffer *1");
BIND(/* m-2 */ "meta-2", "/buffer *2");
BIND(/* m-3 */ "meta-3", "/buffer *3");
BIND(/* m-4 */ "meta-4", "/buffer *4");
BIND(/* m-5 */ "meta-5", "/buffer *5");
BIND(/* m-6 */ "meta-6", "/buffer *6");
BIND(/* m-7 */ "meta-7", "/buffer *7");
BIND(/* m-8 */ "meta-8", "/buffer *8");
BIND(/* m-9 */ "meta-9", "/buffer *9");
BIND(/* m-< */ "meta-<", "/input jump_previously_visited_buffer");
BIND(/* m-> */ "meta->", "/input jump_next_visited_buffer");
/* bind meta-j + {01..99} to switch to buffers # > 10 */
for (i = 1; i < 100; i++)
{
sprintf (key_str, "meta-j%02d", i);
sprintf (command, "/buffer %d", i);
BIND(key_str, command);
}
}
/*
* gui_keyboard_flush: flush keyboard buffer
*/
void
gui_keyboard_flush ()
{
int i, key, insert_ok;
char key_str[32], *key_utf, *input_old;
/*
* if there's no paste pending, then we use buffer and do actions
* according to keys
*/
if (!gui_keyboard_paste_pending)
{
if (gui_keyboard_buffer_size > 0)
gui_keyboard_last_activity_time = time (NULL);
for (i = 0; i < gui_keyboard_buffer_size; i++)
{
key = gui_keyboard_buffer[i];
insert_ok = 1;
if (key < 32)
{
insert_ok = 0;
key_str[0] = '^';
key_str[1] = (char) key + '@';
key_str[2] = '\0';
}
else if (key == 127)
{
key_str[0] = '^';
key_str[1] = '?';
key_str[2] = '\0';
}
else
{
if (local_utf8)
{
/* 1 char: 0vvvvvvv */
if (key < 0x80)
{
key_str[0] = (char) key;
key_str[1] = '\0';
}
/* 2 chars: 110vvvvv 10vvvvvv */
else if ((key & 0xE0) == 0xC0)
{
key_str[0] = (char) key;
if (i < gui_keyboard_buffer_size - 1)
{
key_str[1] = (char) (gui_keyboard_buffer[++i]);
key_str[2] = '\0';
}
else
key_str[1] = '\0';
}
/* 3 chars: 1110vvvv 10vvvvvv 10vvvvvv */
else if ((key & 0xF0) == 0xE0)
{
key_str[0] = (char) key;
if (i < gui_keyboard_buffer_size - 1)
{
key_str[1] = (char) (gui_keyboard_buffer[++i]);
if (i < gui_keyboard_buffer_size - 1)
{
key_str[2] = (char) (gui_keyboard_buffer[++i]);
key_str[3] = '\0';
}
else
key_str[2] = '\0';
}
else
key_str[1] = '\0';
}
/* 4 chars: 11110vvv 10vvvvvv 10vvvvvv 10vvvvvv */
else if ((key & 0xF8) == 0xF0)
{
key_str[0] = (char) key;
if (i < gui_keyboard_buffer_size - 1)
{
key_str[1] = (char) (gui_keyboard_buffer[++i]);
if (i < gui_keyboard_buffer_size - 1)
{
key_str[2] = (char) (gui_keyboard_buffer[++i]);
if (i < gui_keyboard_buffer_size - 1)
{
key_str[3] = (char) (gui_keyboard_buffer[++i]);
key_str[4] = '\0';
}
else
key_str[3] = '\0';
}
else
key_str[2] = '\0';
}
else
key_str[1] = '\0';
}
}
else
{
key_str[0] = (char) key;
key_str[1] = '\0';
/* convert input to UTF-8 is user is not using UTF-8 as locale */
if (!local_utf8)
{
key_utf = string_iconv_to_internal (NULL, key_str);
strncpy (key_str, key_utf, sizeof (key_str));
key_str[sizeof (key_str) - 1] = '\0';
}
}
}
if (strcmp (key_str, "^") == 0)
{
key_str[1] = '^';
key_str[2] = '\0';
}
/*gui_printf (gui_current_window->buffer,
"gui_input_read: key = %s (%d)\n", key_str, key);*/
hook_signal_send ("key_pressed",
WEECHAT_HOOK_SIGNAL_STRING, key_str);
if (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
input_old = (gui_current_window->buffer->input_buffer) ?
strdup (gui_current_window->buffer->input_buffer) : strdup ("");
else
input_old = NULL;
if ((gui_keyboard_pressed (key_str) != 0) && (insert_ok))
{
if (strcmp (key_str, "^^") == 0)
key_str[1] = '\0';
gui_buffer_undo_snap (gui_current_window->buffer);
gui_input_insert_string (gui_current_window->buffer,
key_str, -1);
if (gui_current_window->buffer->completion)
gui_completion_stop (gui_current_window->buffer->completion, 0);
gui_input_text_changed_modifier_and_signal (gui_current_window->buffer, 1);
}
/* incremental text search in buffer */
if ((gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
&& ((input_old == NULL)
|| (gui_current_window->buffer->input_buffer == NULL)
|| (strcmp (input_old, gui_current_window->buffer->input_buffer) != 0)))
{
/*
* if current input is longer than old input, and that
* beginning of current input is exactly equal to old input,
* then do nothing (search will not find any result and can
* take some time on buffer with many lines..)
*/
if (!gui_current_window->buffer->text_search_found
&& (input_old != NULL)
&& (input_old[0])
&& (gui_current_window->buffer->input_buffer != NULL)
&& (gui_current_window->buffer->input_buffer[0])
&& (strlen (gui_current_window->buffer->input_buffer) > strlen (input_old))
&& (strncmp (gui_current_window->buffer->input_buffer, input_old,
strlen (input_old)) == 0))
{
/*
* do not search text in buffer, just alert about text not
* found
*/
if (CONFIG_BOOLEAN(config_look_search_text_not_found_alert))
printf ("\a");
}
else
{
gui_window_search_restart (gui_current_window);
}
}
if (input_old)
free (input_old);
}
if (gui_key_grab && (gui_key_grab_count > 0))
gui_keyboard_grab_end ();
gui_keyboard_buffer_reset ();
}
}
/*
* gui_keyboard_read_cb: read keyboard chars
*/
int
gui_keyboard_read_cb (void *data, int fd)
{
int ret, i, accept_paste, cancel_paste, text_added_to_buffer, paste_lines;
unsigned char buffer[4096];
/* make C compiler happy */
(void) data;
(void) fd;
accept_paste = 0;
cancel_paste = 0;
text_added_to_buffer = 0;
if (gui_keyboard_paste_pending)
{
ret = read (STDIN_FILENO, buffer, 1);
if (ret == 0)
{
/* no data on stdin, terminal lost */
log_printf (_("Terminal lost, exiting WeeChat..."));
hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
weechat_quit = 1;
return WEECHAT_RC_OK;
}
if (ret <= 0)
return WEECHAT_RC_OK;
/* ctrl-Y: accept paste */
if (buffer[0] == 25)
accept_paste = 1;
/* ctrl-N: cancel paste */
if (buffer[0] == 14)
cancel_paste = 1;
}
else
{
ret = read (STDIN_FILENO, buffer, sizeof (buffer));
if (ret == 0)
{
/* no data on stdin, terminal lost */
log_printf (_("Terminal lost, exiting WeeChat..."));
hook_signal_send ("quit", WEECHAT_HOOK_SIGNAL_STRING, NULL);
weechat_quit = 1;
return WEECHAT_RC_OK;
}
if (ret < 0)
return WEECHAT_RC_OK;
for (i = 0; i < ret; i++)
{
gui_keyboard_buffer_add (buffer[i]);
}
text_added_to_buffer = 1;
}
if (gui_keyboard_paste_pending)
{
/* user is ok for pasting text, let's paste! */
if (accept_paste)
gui_keyboard_paste_accept ();
/* user doesn't want to paste text: clear whole buffer! */
else if (cancel_paste)
gui_keyboard_paste_cancel ();
else if (text_added_to_buffer)
gui_input_text_changed_modifier_and_signal (gui_current_window->buffer, 0);
}
else
{
/*
* detect user paste or large amount of text
* if so, ask user what to do
*/
if (CONFIG_INTEGER(config_look_paste_max_lines) > 0)
{
paste_lines = gui_keyboard_get_paste_lines ();
if (paste_lines > CONFIG_INTEGER(config_look_paste_max_lines))
{
gui_keyboard_paste_pending = 1;
gui_input_paste_pending_signal ();
}
}
}
gui_keyboard_flush ();
return WEECHAT_RC_OK;
}
+1 -1
View File
@@ -314,7 +314,7 @@ gui_main_loop ()
/* hook stdin (read keyboard) */
hook_fd_keyboard = hook_fd (NULL, STDIN_FILENO, 1, 0, 0,
&gui_keyboard_read_cb, NULL);
&gui_key_read_cb, NULL);
gui_window_ask_refresh (1);
+1
View File
@@ -48,6 +48,7 @@
#include "../gui-color.h"
#include "../gui-hotlist.h"
#include "../gui-input.h"
#include "../gui-key.h"
#include "../gui-main.h"
#include "../gui-line.h"
#include "../gui-nicklist.h"
+3 -3
View File
@@ -78,9 +78,9 @@ extern void gui_chat_calculate_line_diff (struct t_gui_window *window,
struct t_gui_line **line,
int *line_pos, int difference);
/* keyboard functions */
extern void gui_keyboard_default_bindings ();
extern int gui_keyboard_read_cb (void *data, int fd);
/* key functions */
extern void gui_key_default_bindings (int context);
extern int gui_key_read_cb (void *data, int fd);
/* window functions */
extern void gui_window_read_terminal_size ();
+1 -1
View File
@@ -23,7 +23,7 @@ gui-gtk.h
gui-gtk-bar-window.c
gui-gtk-chat.c
gui-gtk-color.c
gui-gtk-keyboard.c
gui-gtk-key.c
gui-gtk-main.c
gui-gtk-term.c
gui-gtk-window.c)
+1 -1
View File
@@ -35,7 +35,7 @@ weechat_gtk_LDADD = ./../../core/lib_weechat_core.a \
weechat_gtk_SOURCES = gui-gtk-bar-window.c \
gui-gtk-chat.c \
gui-gtk-color.c \
gui-gtk-keyboard.c \
gui-gtk-key.c \
gui-gtk-main.c \
gui-gtk-term.c \
gui-gtk-window.c \
@@ -31,27 +31,28 @@
#include "../../core/weechat.h"
#include "../../core/wee-utf8.h"
#include "../../plugins/plugin.h"
#include "../gui-keyboard.h"
#include "../gui-key.h"
#include "../gui-buffer.h"
#include "gui-gtk.h"
/*
* gui_keyboard_default_bindings: create default key bindings
* gui_key_default_bindings: create default key bindings
*/
void
gui_keyboard_default_bindings ()
gui_key_default_bindings (int context)
{
/* TODO: write this function for Gtk */
(void) context;
}
/*
* gui_keyboard_read: read keyboard chars
* gui_key_read: read keyboard chars
*/
void
gui_keyboard_read ()
gui_key_read ()
{
/* TODO: write this function for Gtk */
}
+4 -4
View File
@@ -98,10 +98,10 @@ extern void gui_chat_calculate_line_diff (struct t_gui_window *window,
struct t_gui_line **line,
int *line_pos, int difference);
/* keyboard functions */
extern void gui_keyboard_default_bindings ();
extern void gui_keyboard_read ();
extern void gui_keyboard_flush ();
/* key functions */
extern void gui_key_default_bindings (int context);
extern void gui_key_read ();
extern void gui_key_flush ();
/* window functions */
extern void gui_window_redraw_buffer (struct t_gui_buffer *buffer);
+3 -3
View File
@@ -49,7 +49,7 @@
#include "gui-completion.h"
#include "gui-filter.h"
#include "gui-hotlist.h"
#include "gui-keyboard.h"
#include "gui-key.h"
#include "gui-line.h"
#include "gui-nicklist.h"
#include "gui-window.h"
@@ -628,7 +628,7 @@ gui_bar_item_default_input_paste (void *data, struct t_gui_bar_item *item,
if (window != gui_current_window)
return NULL;
if (!gui_keyboard_paste_pending)
if (!gui_key_paste_pending)
return NULL;
ptr_message = _(text_paste_pending);
@@ -637,7 +637,7 @@ gui_bar_item_default_input_paste (void *data, struct t_gui_bar_item *item,
if (buf)
snprintf (buf, length, ptr_message,
gui_color_get_custom (gui_color_get_name (CONFIG_COLOR(config_color_input_actions))),
gui_keyboard_get_paste_lines ());
gui_key_get_paste_lines ());
return buf;
}
+8 -8
View File
@@ -53,7 +53,7 @@
#include "gui-history.h"
#include "gui-hotlist.h"
#include "gui-input.h"
#include "gui-keyboard.h"
#include "gui-key.h"
#include "gui-layout.h"
#include "gui-line.h"
#include "gui-main.h"
@@ -1532,17 +1532,17 @@ gui_buffer_set (struct t_gui_buffer *buffer, const char *property,
}
else if (string_strncasecmp (property, "key_bind_", 9) == 0)
{
gui_keyboard_bind (buffer, property + 9, value);
gui_key_bind (buffer, 0, property + 9, value);
}
else if (string_strncasecmp (property, "key_unbind_", 11) == 0)
{
if (strcmp (property + 11, "*") == 0)
{
gui_keyboard_free_all (&buffer->keys, &buffer->last_key,
&buffer->keys_count);
gui_key_free_all (&buffer->keys, &buffer->last_key,
&buffer->keys_count);
}
else
gui_keyboard_unbind (buffer, property + 11, 1);
gui_key_unbind (buffer, 0, property + 11, 1);
}
else if (string_strcasecmp (property, "input") == 0)
{
@@ -2138,8 +2138,8 @@ gui_buffer_close (struct t_gui_buffer *buffer)
string_free_split (buffer->highlight_tags_array);
if (buffer->hotlist_max_level_nicks)
hashtable_free (buffer->hotlist_max_level_nicks);
gui_keyboard_free_all (&buffer->keys, &buffer->last_key,
&buffer->keys_count);
gui_key_free_all (&buffer->keys, &buffer->last_key,
&buffer->keys_count);
gui_buffer_local_var_remove_all (buffer);
hashtable_free (buffer->local_variables);
@@ -3365,7 +3365,7 @@ gui_buffer_print_log ()
{
log_printf ("");
log_printf (" => keys:");
gui_keyboard_print_log (ptr_buffer);
gui_key_print_log (ptr_buffer);
}
if (ptr_buffer->local_variables)
+175 -130
View File
@@ -40,7 +40,7 @@
#include "gui-completion.h"
#include "gui-history.h"
#include "gui-hotlist.h"
#include "gui-keyboard.h"
#include "gui-key.h"
#include "gui-line.h"
#include "gui-window.h"
@@ -341,35 +341,28 @@ gui_input_return (struct t_gui_buffer *buffer)
char *command;
window = gui_window_search_with_buffer (buffer);
if (window && window->buffer->input)
if (window && window->buffer->input
&& (window->buffer->input_buffer_size > 0))
{
if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
command = strdup (window->buffer->input_buffer);
if (command)
{
gui_window_search_stop (window);
gui_input_search_signal ();
}
else if (window->buffer->input_buffer_size > 0)
{
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
command = strdup (window->buffer->input_buffer);
if (command)
{
gui_history_add (window->buffer,
window->buffer->input_buffer);
window->buffer->input_buffer[0] = '\0';
window->buffer->input_buffer_size = 0;
window->buffer->input_buffer_length = 0;
window->buffer->input_buffer_pos = 0;
window->buffer->input_buffer_1st_display = 0;
gui_completion_stop (window->buffer->completion, 1);
gui_buffer_undo_free_all (window->buffer);
window->buffer->ptr_history = NULL;
history_global_ptr = NULL;
gui_input_optimize_size (window->buffer);
gui_input_text_changed_modifier_and_signal (window->buffer, 0);
input_data (window->buffer, command);
free (command);
}
gui_history_add (window->buffer,
window->buffer->input_buffer);
window->buffer->input_buffer[0] = '\0';
window->buffer->input_buffer_size = 0;
window->buffer->input_buffer_length = 0;
window->buffer->input_buffer_pos = 0;
window->buffer->input_buffer_1st_display = 0;
gui_completion_stop (window->buffer->completion, 1);
gui_buffer_undo_free_all (window->buffer);
window->buffer->ptr_history = NULL;
history_global_ptr = NULL;
gui_input_optimize_size (window->buffer);
gui_input_text_changed_modifier_and_signal (window->buffer, 0);
input_data (window->buffer, command);
free (command);
}
}
}
@@ -498,7 +491,7 @@ gui_input_complete_previous (struct t_gui_buffer *buffer)
}
/*
* gui_input_search_text: search text in buffer history (default key: ctrl-r)
* gui_input_search_text: search text in buffer (default key: ctrl-r)
*/
void
@@ -507,16 +500,86 @@ gui_input_search_text (struct t_gui_buffer *buffer)
struct t_gui_window *window;
window = gui_window_search_with_buffer (buffer);
if (window && (window->buffer->type == GUI_BUFFER_TYPE_FORMATTED))
if (window && (window->buffer->type == GUI_BUFFER_TYPE_FORMATTED)
&& (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
/* toggle search */
if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
gui_window_search_start (window);
else
{
window->buffer->text_search_exact ^= 1;
gui_window_search_restart (window);
}
gui_window_search_start (window);
gui_input_search_signal ();
}
}
/*
* gui_input_search_previous: search backward in buffer (default key: up during
* search)
*/
void
gui_input_search_previous (struct t_gui_buffer *buffer)
{
struct t_gui_window *window;
window = gui_window_search_with_buffer (buffer);
if (window && (window->buffer->type == GUI_BUFFER_TYPE_FORMATTED)
&& (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED))
{
window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD;
(void) gui_window_search_text (window);
}
}
/*
* gui_input_search_next: search forward in buffer (default key: down during
* search)
*/
void
gui_input_search_next (struct t_gui_buffer *buffer)
{
struct t_gui_window *window;
window = gui_window_search_with_buffer (buffer);
if (window && (window->buffer->type == GUI_BUFFER_TYPE_FORMATTED)
&& (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED))
{
window->buffer->text_search = GUI_TEXT_SEARCH_FORWARD;
(void) gui_window_search_text (window);
}
}
/*
* gui_input_search_switch_case: switch case for search in buffer (default key:
* ctrl-r during search)
*/
void
gui_input_search_switch_case (struct t_gui_buffer *buffer)
{
struct t_gui_window *window;
window = gui_window_search_with_buffer (buffer);
if (window && (window->buffer->type == GUI_BUFFER_TYPE_FORMATTED)
&& (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED))
{
window->buffer->text_search_exact ^= 1;
gui_window_search_restart (window);
gui_input_search_signal ();
}
}
/*
* gui_input_search_stop: stop text search (default key: return during search)
*/
void
gui_input_search_stop (struct t_gui_buffer *buffer)
{
struct t_gui_window *window;
window = gui_window_search_with_buffer (buffer);
if (window && (window->buffer->type == GUI_BUFFER_TYPE_FORMATTED)
&& (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED))
{
gui_window_search_stop (window);
gui_input_search_signal ();
}
}
@@ -948,57 +1011,48 @@ gui_input_history_previous (struct t_gui_window *window,
if (!window->buffer->input)
return;
if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
if (*ptr_history)
{
if (*ptr_history)
{
if (!(*ptr_history)->next_history)
return;
*ptr_history = (*ptr_history)->next_history;
}
if (!(*ptr_history))
*ptr_history = history;
if (!(*ptr_history))
if (!(*ptr_history)->next_history)
return;
/* bash/readline like use of history */
if (window->buffer->input_buffer_size > 0)
{
if ((*ptr_history)->prev_history)
{
/* replace text in history with current input */
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
if ((*ptr_history)->prev_history->text)
free ((*ptr_history)->prev_history->text);
(*ptr_history)->prev_history->text =
strdup (window->buffer->input_buffer);
}
else
{
/* add current input in history */
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
gui_history_add (window->buffer,
window->buffer->input_buffer);
}
}
window->buffer->input_buffer_size =
strlen ((*ptr_history)->text);
window->buffer->input_buffer_length =
utf8_strlen ((*ptr_history)->text);
gui_input_optimize_size (window->buffer);
window->buffer->input_buffer_pos = window->buffer->input_buffer_length;
window->buffer->input_buffer_1st_display = 0;
strcpy (window->buffer->input_buffer, (*ptr_history)->text);
gui_input_text_changed_modifier_and_signal (window->buffer, 0);
gui_buffer_undo_free_all (window->buffer);
*ptr_history = (*ptr_history)->next_history;
}
else
if (!(*ptr_history))
*ptr_history = history;
if (!(*ptr_history))
return;
/* bash/readline like use of history */
if (window->buffer->input_buffer_size > 0)
{
/* search backward in buffer history */
window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD;
(void) gui_window_search_text (window);
if ((*ptr_history)->prev_history)
{
/* replace text in history with current input */
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
if ((*ptr_history)->prev_history->text)
free ((*ptr_history)->prev_history->text);
(*ptr_history)->prev_history->text =
strdup (window->buffer->input_buffer);
}
else
{
/* add current input in history */
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
gui_history_add (window->buffer,
window->buffer->input_buffer);
}
}
window->buffer->input_buffer_size =
strlen ((*ptr_history)->text);
window->buffer->input_buffer_length =
utf8_strlen ((*ptr_history)->text);
gui_input_optimize_size (window->buffer);
window->buffer->input_buffer_pos = window->buffer->input_buffer_length;
window->buffer->input_buffer_1st_display = 0;
strcpy (window->buffer->input_buffer, (*ptr_history)->text);
gui_input_text_changed_modifier_and_signal (window->buffer, 0);
gui_buffer_undo_free_all (window->buffer);
}
/*
@@ -1020,62 +1074,53 @@ gui_input_history_next (struct t_gui_window *window,
if (!window->buffer->input)
return;
if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
if (*ptr_history)
{
*ptr_history = (*ptr_history)->prev_history;
if (*ptr_history)
{
*ptr_history = (*ptr_history)->prev_history;
if (*ptr_history)
{
window->buffer->input_buffer_size =
strlen ((*ptr_history)->text);
window->buffer->input_buffer_length =
utf8_strlen ((*ptr_history)->text);
}
else
{
window->buffer->input_buffer[0] = '\0';
window->buffer->input_buffer_size = 0;
window->buffer->input_buffer_length = 0;
}
gui_input_optimize_size (window->buffer);
window->buffer->input_buffer_pos =
window->buffer->input_buffer_length;
window->buffer->input_buffer_1st_display = 0;
if (*ptr_history)
{
strcpy (window->buffer->input_buffer, (*ptr_history)->text);
}
input_changed = 1;
window->buffer->input_buffer_size =
strlen ((*ptr_history)->text);
window->buffer->input_buffer_length =
utf8_strlen ((*ptr_history)->text);
}
else
{
/* add line to history then clear input */
if (window->buffer->input_buffer_size > 0)
{
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
gui_history_add (window->buffer,
window->buffer->input_buffer);
window->buffer->input_buffer[0] = '\0';
window->buffer->input_buffer_size = 0;
window->buffer->input_buffer_length = 0;
window->buffer->input_buffer_pos = 0;
window->buffer->input_buffer_1st_display = 0;
gui_input_optimize_size (window->buffer);
input_changed = 1;
}
window->buffer->input_buffer[0] = '\0';
window->buffer->input_buffer_size = 0;
window->buffer->input_buffer_length = 0;
}
if (input_changed)
gui_input_optimize_size (window->buffer);
window->buffer->input_buffer_pos =
window->buffer->input_buffer_length;
window->buffer->input_buffer_1st_display = 0;
if (*ptr_history)
{
gui_input_text_changed_modifier_and_signal (window->buffer, 0);
gui_buffer_undo_free_all (window->buffer);
strcpy (window->buffer->input_buffer, (*ptr_history)->text);
}
input_changed = 1;
}
else
{
/* search forward in buffer history */
window->buffer->text_search = GUI_TEXT_SEARCH_FORWARD;
(void) gui_window_search_text (window);
/* add line to history then clear input */
if (window->buffer->input_buffer_size > 0)
{
window->buffer->input_buffer[window->buffer->input_buffer_size] = '\0';
gui_history_add (window->buffer,
window->buffer->input_buffer);
window->buffer->input_buffer[0] = '\0';
window->buffer->input_buffer_size = 0;
window->buffer->input_buffer_length = 0;
window->buffer->input_buffer_pos = 0;
window->buffer->input_buffer_1st_display = 0;
gui_input_optimize_size (window->buffer);
input_changed = 1;
}
}
if (input_changed)
{
gui_input_text_changed_modifier_and_signal (window->buffer, 0);
gui_buffer_undo_free_all (window->buffer);
}
}
@@ -1297,7 +1342,7 @@ void
gui_input_grab_key (struct t_gui_buffer *buffer)
{
if (buffer->input)
gui_keyboard_grab_init (0);
gui_key_grab_init (0);
}
/*
@@ -1309,7 +1354,7 @@ void
gui_input_grab_key_command (struct t_gui_buffer *buffer)
{
if (buffer->input)
gui_keyboard_grab_init (1);
gui_key_grab_init (1);
}
/*
+4
View File
@@ -43,6 +43,10 @@ extern void gui_input_return (struct t_gui_buffer *buffer);
extern void gui_input_complete_next (struct t_gui_buffer *buffer);
extern void gui_input_complete_previous (struct t_gui_buffer *buffer);
extern void gui_input_search_text (struct t_gui_buffer *buffer);
extern void gui_input_search_previous (struct t_gui_buffer *buffer);
extern void gui_input_search_next (struct t_gui_buffer *buffer);
extern void gui_input_search_switch_case (struct t_gui_buffer *buffer);
extern void gui_input_search_stop (struct t_gui_buffer *buffer);
extern void gui_input_delete_previous_char (struct t_gui_buffer *buffer);
extern void gui_input_delete_next_char (struct t_gui_buffer *buffer);
extern void gui_input_delete_previous_word (struct t_gui_buffer *buffer);
+285 -197
View File
@@ -18,7 +18,7 @@
*/
/*
* gui-keyboard: keyboard functions (used by all GUI)
* gui-key.c: keyboard functions (used by all GUI)
*/
#ifdef HAVE_CONFIG_H
@@ -40,7 +40,7 @@
#include "../core/wee-string.h"
#include "../core/wee-utf8.h"
#include "../plugins/plugin.h"
#include "gui-keyboard.h"
#include "gui-key.h"
#include "gui-buffer.h"
#include "gui-chat.h"
#include "gui-color.h"
@@ -49,60 +49,106 @@
#include "gui-window.h"
struct t_gui_key *gui_keys = NULL; /* key bindings */
struct t_gui_key *last_gui_key = NULL; /* last key binding */
struct t_gui_key *gui_default_keys = NULL; /* default key bindings */
struct t_gui_key *last_gui_default_key = NULL; /* last default key binding */
struct t_gui_key *gui_keys[GUI_KEY_NUM_CONTEXTS]; /* keys by context */
struct t_gui_key *last_gui_key[GUI_KEY_NUM_CONTEXTS]; /* last key */
struct t_gui_key *gui_default_keys[GUI_KEY_NUM_CONTEXTS]; /* default keys */
struct t_gui_key *last_gui_default_key[GUI_KEY_NUM_CONTEXTS];
int gui_keys_count[GUI_KEY_NUM_CONTEXTS]; /* keys number */
int gui_default_keys_count[GUI_KEY_NUM_CONTEXTS]; /* default keys number */
int gui_keys_count = 0; /* number of defined keys */
int gui_default_keys_count = 0; /* number of default keys */
char *gui_key_context_string[GUI_KEY_NUM_CONTEXTS] =
{ "default", "search" };
int gui_keyboard_verbose = 0; /* 1 to see some messages */
int gui_key_verbose = 0; /* 1 to see some messages */
char gui_key_combo_buffer[128]; /* buffer used for combos */
int gui_key_grab = 0; /* 1 if grab mode enabled (alt-k) */
int gui_key_grab_count = 0; /* number of keys pressed in grab mode */
int gui_key_grab_command = 0; /* grab command bound to key? */
int *gui_keyboard_buffer = NULL; /* input buffer (for paste detection) */
int gui_keyboard_buffer_alloc = 0; /* input buffer allocated size */
int gui_keyboard_buffer_size = 0; /* input buffer size in bytes */
int *gui_key_buffer = NULL; /* input buffer (for paste detection) */
int gui_key_buffer_alloc = 0; /* input buffer allocated size */
int gui_key_buffer_size = 0; /* input buffer size in bytes */
int gui_keyboard_paste_pending = 0; /* 1 is big paste was detected and */
int gui_key_paste_pending = 0; /* 1 is big paste was detected and */
/* WeeChat is asking user what to do */
int gui_keyboard_paste_lines = 0; /* number of lines for pending paste */
int gui_key_paste_lines = 0; /* number of lines for pending paste */
time_t gui_keyboard_last_activity_time = 0; /* last activity time (key) */
time_t gui_key_last_activity_time = 0; /* last activity time (key) */
/*
* gui_keyboard_init: init keyboard
* gui_key_init: init keyboard
*/
void
gui_keyboard_init ()
gui_key_init ()
{
int i;
gui_key_combo_buffer[0] = '\0';
gui_key_grab = 0;
gui_key_grab_count = 0;
gui_keyboard_last_activity_time = time (NULL);
gui_key_last_activity_time = time (NULL);
/* create default keys and save them in a separate list */
gui_keyboard_default_bindings ();
gui_default_keys = gui_keys;
last_gui_default_key = last_gui_key;
gui_default_keys_count = gui_keys_count;
gui_keys = NULL;
last_gui_key = NULL;
gui_keys_count = 0;
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
gui_keys[i] = NULL;
last_gui_key[i] = NULL;
gui_default_keys[i] = NULL;
last_gui_default_key[i] = NULL;
gui_keys_count[i] = 0;
gui_default_keys_count[i] = 0;
gui_key_default_bindings (i);
gui_default_keys[i] = gui_keys[i];
last_gui_default_key[i] = last_gui_key[i];
gui_default_keys_count[i] = gui_keys_count[i];
gui_keys[i] = NULL;
last_gui_key[i] = NULL;
gui_keys_count[i] = 0;
}
}
/*
* gui_keyboard_grab_init: init "grab" mode
* gui_key_search_context: search context by name
*/
int
gui_key_search_context (const char *context)
{
int i;
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
if (string_strcasecmp (gui_key_context_string[i], context) == 0)
return i;
}
/* context not found */
return -1;
}
/*
* gui_key_get_current_context: get current context
*/
int
gui_key_get_current_context ()
{
if (gui_current_window
&& (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED))
return GUI_KEY_CONTEXT_SEARCH;
return GUI_KEY_CONTEXT_DEFAULT;
}
/*
* gui_key_grab_init: init "grab" mode
*/
void
gui_keyboard_grab_init (int grab_command)
gui_key_grab_init (int grab_command)
{
gui_key_grab = 1;
gui_key_grab_count = 0;
@@ -110,17 +156,17 @@ gui_keyboard_grab_init (int grab_command)
}
/*
* gui_keyboard_grab_end: insert grabbed key in input buffer
* gui_key_grab_end: insert grabbed key in input buffer
*/
void
gui_keyboard_grab_end ()
gui_key_grab_end ()
{
char *expanded_key;
struct t_gui_key *ptr_key;
/* get expanded name (for example: ^U => ctrl-u) */
expanded_key = gui_keyboard_get_expanded_name (gui_key_combo_buffer);
expanded_key = gui_key_get_expanded_name (gui_key_combo_buffer);
if (expanded_key)
{
@@ -129,7 +175,8 @@ gui_keyboard_grab_end ()
gui_input_insert_string (gui_current_window->buffer, expanded_key, -1);
if (gui_key_grab_command)
{
ptr_key = gui_keyboard_search (gui_keys, gui_key_combo_buffer);
ptr_key = gui_key_search (gui_keys[GUI_KEY_CONTEXT_DEFAULT],
gui_key_combo_buffer);
if (ptr_key)
{
gui_input_insert_string (gui_current_window->buffer, " ", -1);
@@ -151,12 +198,12 @@ gui_keyboard_grab_end ()
}
/*
* gui_keyboard_get_internal_code: get internal code from user key name
* for example: return "^R" for "ctrl-R"
* gui_key_get_internal_code: get internal code from user key name
* for example: return "^R" for "ctrl-R"
*/
char *
gui_keyboard_get_internal_code (const char *key)
gui_key_get_internal_code (const char *key)
{
char *result;
@@ -194,12 +241,12 @@ gui_keyboard_get_internal_code (const char *key)
}
/*
* gui_keyboard_get_expanded_name: get expanded name from internal key code
* for example: return "ctrl-R" for "^R"
* gui_key_get_expanded_name: get expanded name from internal key code
* for example: return "ctrl-R" for "^R"
*/
char *
gui_keyboard_get_expanded_name (const char *key)
gui_key_get_expanded_name (const char *key)
{
char *result;
@@ -239,11 +286,11 @@ gui_keyboard_get_expanded_name (const char *key)
}
/*
* gui_keyboard_find_pos: find position for a key (for sorting keys list)
* gui_key_find_pos: find position for a key (for sorting keys list)
*/
struct t_gui_key *
gui_keyboard_find_pos (struct t_gui_key *keys, struct t_gui_key *key)
gui_key_find_pos (struct t_gui_key *keys, struct t_gui_key *key)
{
struct t_gui_key *ptr_key;
@@ -256,20 +303,20 @@ gui_keyboard_find_pos (struct t_gui_key *keys, struct t_gui_key *key)
}
/*
* gui_keyboard_insert_sorted: insert key into sorted list
* gui_key_insert_sorted: insert key into sorted list
*/
void
gui_keyboard_insert_sorted (struct t_gui_key **keys,
struct t_gui_key **last_key,
int *keys_count,
struct t_gui_key *key)
gui_key_insert_sorted (struct t_gui_key **keys,
struct t_gui_key **last_key,
int *keys_count,
struct t_gui_key *key)
{
struct t_gui_key *pos_key;
if (*keys)
{
pos_key = gui_keyboard_find_pos (*keys, key);
pos_key = gui_key_find_pos (*keys, key);
if (pos_key)
{
@@ -304,14 +351,14 @@ gui_keyboard_insert_sorted (struct t_gui_key **keys,
}
/*
* gui_keyboard_new: add a new key in keys list
* if buffer is not null, then key is specific to buffer
* otherwise it's general key (for most keys)
* gui_key_new: add a new key in keys list
* if buffer is not null, then key is specific to buffer
* otherwise it's general key (for most keys)
*/
struct t_gui_key *
gui_keyboard_new (struct t_gui_buffer *buffer, const char *key,
const char *command)
gui_key_new (struct t_gui_buffer *buffer, int context, const char *key,
const char *command)
{
struct t_gui_key *new_key;
char *expanded_name;
@@ -321,7 +368,7 @@ gui_keyboard_new (struct t_gui_buffer *buffer, const char *key,
if ((new_key = malloc (sizeof (*new_key))))
{
new_key->key = gui_keyboard_get_internal_code (key);
new_key->key = gui_key_get_internal_code (key);
if (!new_key->key)
new_key->key = strdup (key);
if (!new_key->key)
@@ -339,21 +386,22 @@ gui_keyboard_new (struct t_gui_buffer *buffer, const char *key,
if (buffer)
{
gui_keyboard_insert_sorted (&buffer->keys, &buffer->last_key,
&buffer->keys_count, new_key);
gui_key_insert_sorted (&buffer->keys, &buffer->last_key,
&buffer->keys_count, new_key);
}
else
{
gui_keyboard_insert_sorted (&gui_keys, &last_gui_key,
&gui_keys_count, new_key);
gui_key_insert_sorted (&gui_keys[context],
&last_gui_key[context],
&gui_keys_count[context], new_key);
}
expanded_name = gui_keyboard_get_expanded_name (new_key->key);
expanded_name = gui_key_get_expanded_name (new_key->key);
hook_signal_send ("key_bind",
WEECHAT_HOOK_SIGNAL_STRING, expanded_name);
if (gui_keyboard_verbose)
if (gui_key_verbose)
{
gui_chat_printf (NULL,
_("New key binding: %s%s => %s%s"),
@@ -372,11 +420,11 @@ gui_keyboard_new (struct t_gui_buffer *buffer, const char *key,
}
/*
* gui_keyboard_search: search a key
* gui_key_search: search a key
*/
struct t_gui_key *
gui_keyboard_search (struct t_gui_key *keys, const char *key)
gui_key_search (struct t_gui_key *keys, const char *key)
{
struct t_gui_key *ptr_key;
@@ -391,11 +439,11 @@ gui_keyboard_search (struct t_gui_key *keys, const char *key)
}
/*
* gui_keyboard_cmp: compares 2 keys
* gui_key_cmp: compares 2 keys
*/
int
gui_keyboard_cmp (const char *key, const char *search)
gui_key_cmp (const char *key, const char *search)
{
int diff;
@@ -412,18 +460,19 @@ gui_keyboard_cmp (const char *key, const char *search)
}
/*
* gui_keyboard_search_part: search a key (maybe part of string)
* gui_key_search_part: search a key (maybe part of string)
*/
struct t_gui_key *
gui_keyboard_search_part (struct t_gui_buffer *buffer, const char *key)
gui_key_search_part (struct t_gui_buffer *buffer, int context,
const char *key)
{
struct t_gui_key *ptr_key;
for (ptr_key = (buffer) ? buffer->keys : gui_keys; ptr_key;
for (ptr_key = (buffer) ? buffer->keys : gui_keys[context]; ptr_key;
ptr_key = ptr_key->next_key)
{
if (ptr_key->key && (gui_keyboard_cmp (ptr_key->key, key) == 0))
if (ptr_key->key && (gui_key_cmp (ptr_key->key, key) == 0))
return ptr_key;
}
@@ -432,13 +481,14 @@ gui_keyboard_search_part (struct t_gui_buffer *buffer, const char *key)
}
/*
* gui_keyboard_bind: bind a key to a function (command or special function)
* if buffer is not null, then key is specific to buffer
* otherwise it's general key (for most keys)
* gui_key_bind: bind a key to a function (command or special function)
* if buffer is not null, then key is specific to buffer
* otherwise it's general key (for most keys)
*/
struct t_gui_key *
gui_keyboard_bind (struct t_gui_buffer *buffer, const char *key, const char *command)
gui_key_bind (struct t_gui_buffer *buffer, int context, const char *key,
const char *command)
{
struct t_gui_key *new_key;
@@ -448,9 +498,9 @@ gui_keyboard_bind (struct t_gui_buffer *buffer, const char *key, const char *com
return NULL;
}
gui_keyboard_unbind (buffer, key, 0);
gui_key_unbind (buffer, context, key, 0);
new_key = gui_keyboard_new (buffer, key, command);
new_key = gui_key_new (buffer, context, key, command);
if (!new_key)
{
log_printf (_("Error: not enough memory for key binding"));
@@ -461,31 +511,31 @@ gui_keyboard_bind (struct t_gui_buffer *buffer, const char *key, const char *com
}
/*
* gui_keyboard_unbind: remove a key binding
* gui_key_unbind: remove a key binding
*/
int
gui_keyboard_unbind (struct t_gui_buffer *buffer, const char *key,
int send_signal)
gui_key_unbind (struct t_gui_buffer *buffer, int context, const char *key,
int send_signal)
{
struct t_gui_key *ptr_key;
char *internal_code;
internal_code = gui_keyboard_get_internal_code (key);
internal_code = gui_key_get_internal_code (key);
ptr_key = gui_keyboard_search ((buffer) ? buffer->keys : gui_keys,
(internal_code) ? internal_code : key);
ptr_key = gui_key_search ((buffer) ? buffer->keys : gui_keys[context],
(internal_code) ? internal_code : key);
if (ptr_key)
{
if (buffer)
{
gui_keyboard_free (&buffer->keys, &buffer->last_key,
&buffer->keys_count, ptr_key);
gui_key_free (&buffer->keys, &buffer->last_key,
&buffer->keys_count, ptr_key);
}
else
{
gui_keyboard_free (&gui_keys, &last_gui_key,
&gui_keys_count, ptr_key);
gui_key_free (&gui_keys[context], &last_gui_key[context],
&gui_keys_count[context], ptr_key);
}
}
@@ -502,15 +552,15 @@ gui_keyboard_unbind (struct t_gui_buffer *buffer, const char *key,
}
/*
* gui_keyboard_pressed: treat new key pressed
* return: 1 if key should be added to input buffer
* 0 otherwise
* gui_key_pressed: treat new key pressed
* return: 1 if key should be added to input buffer
* 0 otherwise
*/
int
gui_keyboard_pressed (const char *key_str)
gui_key_pressed (const char *key_str)
{
int first_key;
int first_key, context;
struct t_gui_key *ptr_key;
char *buffer_before_key;
char **commands, **ptr_cmd;
@@ -526,12 +576,32 @@ gui_keyboard_pressed (const char *key_str)
return 0;
}
/* look for key combo in key table for current buffer */
ptr_key = gui_keyboard_search_part (gui_current_window->buffer,
gui_key_combo_buffer);
/* if key is not found for buffer, then look in general table */
if (!ptr_key)
ptr_key = gui_keyboard_search_part (NULL, gui_key_combo_buffer);
context = gui_key_get_current_context ();
switch (context)
{
case GUI_KEY_CONTEXT_DEFAULT:
/* look for key combo in key table for current buffer */
ptr_key = gui_key_search_part (gui_current_window->buffer,
GUI_KEY_CONTEXT_DEFAULT,
gui_key_combo_buffer);
/* if key is not found for buffer, then look in general table */
if (!ptr_key)
ptr_key = gui_key_search_part (NULL,
GUI_KEY_CONTEXT_DEFAULT,
gui_key_combo_buffer);
break;
case GUI_KEY_CONTEXT_SEARCH:
ptr_key = gui_key_search_part (NULL,
GUI_KEY_CONTEXT_SEARCH,
gui_key_combo_buffer);
if (!ptr_key)
{
ptr_key = gui_key_search_part (NULL,
GUI_KEY_CONTEXT_DEFAULT,
gui_key_combo_buffer);
}
break;
}
/* if key is found, then execute action */
if (ptr_key)
@@ -573,12 +643,12 @@ gui_keyboard_pressed (const char *key_str)
}
/*
* gui_keyboard_free: delete a key binding
* gui_key_free: delete a key binding
*/
void
gui_keyboard_free (struct t_gui_key **keys, struct t_gui_key **last_key,
int *keys_count, struct t_gui_key *key)
gui_key_free (struct t_gui_key **keys, struct t_gui_key **last_key,
int *keys_count, struct t_gui_key *key)
{
/* free memory */
if (key->key)
@@ -602,157 +672,161 @@ gui_keyboard_free (struct t_gui_key **keys, struct t_gui_key **last_key,
}
/*
* gui_keyboard_free_all: delete all key bindings
* gui_key_free_all: delete all key bindings
*/
void
gui_keyboard_free_all (struct t_gui_key **keys, struct t_gui_key **last_key,
gui_key_free_all (struct t_gui_key **keys, struct t_gui_key **last_key,
int *keys_count)
{
while (*keys)
{
gui_keyboard_free (keys, last_key, keys_count, *keys);
gui_key_free (keys, last_key, keys_count, *keys);
}
}
/*
* gui_keyboard_buffer_optimize: optimize keyboard buffer size
* gui_key_buffer_optimize: optimize keyboard buffer size
*/
void
gui_keyboard_buffer_optimize ()
gui_key_buffer_optimize ()
{
int optimal_size;
optimal_size = (((gui_keyboard_buffer_size * sizeof (int)) /
GUI_KEYBOARD_BUFFER_BLOCK_SIZE) *
GUI_KEYBOARD_BUFFER_BLOCK_SIZE) +
GUI_KEYBOARD_BUFFER_BLOCK_SIZE;
optimal_size = (((gui_key_buffer_size * sizeof (int)) /
GUI_KEY_BUFFER_BLOCK_SIZE) *
GUI_KEY_BUFFER_BLOCK_SIZE) +
GUI_KEY_BUFFER_BLOCK_SIZE;
if (gui_keyboard_buffer_alloc != optimal_size)
if (gui_key_buffer_alloc != optimal_size)
{
gui_keyboard_buffer_alloc = optimal_size;
gui_keyboard_buffer = realloc (gui_keyboard_buffer, optimal_size);
gui_key_buffer_alloc = optimal_size;
gui_key_buffer = realloc (gui_key_buffer, optimal_size);
}
}
/*
* gui_keyboard_buffer_reset: reset keyboard buffer
* (create empty if never created before)
* gui_key_buffer_reset: reset keyboard buffer
* (create empty if never created before)
*/
void
gui_keyboard_buffer_reset ()
gui_key_buffer_reset ()
{
if (!gui_keyboard_buffer)
if (!gui_key_buffer)
{
gui_keyboard_buffer_alloc = GUI_KEYBOARD_BUFFER_BLOCK_SIZE;
gui_keyboard_buffer_size = 0;
gui_keyboard_buffer = malloc (gui_keyboard_buffer_alloc);
gui_key_buffer_alloc = GUI_KEY_BUFFER_BLOCK_SIZE;
gui_key_buffer_size = 0;
gui_key_buffer = malloc (gui_key_buffer_alloc);
}
else
{
gui_keyboard_buffer_size = 0;
gui_keyboard_buffer_optimize ();
gui_key_buffer_size = 0;
gui_key_buffer_optimize ();
}
gui_keyboard_paste_lines = 0;
gui_key_paste_lines = 0;
}
/*
* gui_keyboard_buffer_add: add a key to keyboard buffer
* gui_key_buffer_add: add a key to keyboard buffer
*/
void
gui_keyboard_buffer_add (unsigned char key)
gui_key_buffer_add (unsigned char key)
{
if (!gui_keyboard_buffer)
gui_keyboard_buffer_reset ();
if (!gui_key_buffer)
gui_key_buffer_reset ();
gui_keyboard_buffer_size++;
gui_key_buffer_size++;
gui_keyboard_buffer_optimize ();
gui_key_buffer_optimize ();
if (gui_keyboard_buffer)
if (gui_key_buffer)
{
gui_keyboard_buffer[gui_keyboard_buffer_size - 1] = key;
gui_key_buffer[gui_key_buffer_size - 1] = key;
if ((key == 13)
&& (gui_keyboard_buffer_size > 1)
&& (gui_keyboard_buffer[gui_keyboard_buffer_size - 2] != 13))
gui_keyboard_paste_lines++;
&& (gui_key_buffer_size > 1)
&& (gui_key_buffer[gui_key_buffer_size - 2] != 13))
gui_key_paste_lines++;
}
else
{
gui_keyboard_buffer_alloc = 0;
gui_keyboard_buffer_size = 0;
gui_keyboard_paste_lines = 0;
gui_key_buffer_alloc = 0;
gui_key_buffer_size = 0;
gui_key_paste_lines = 0;
}
}
/*
* gui_keyboard_get_paste_lines: return real number of lines in buffer
* if last key is not Return, then this is lines + 1
* else it's lines
* gui_key_get_paste_lines: return real number of lines in buffer
* if last key is not Return, then this is lines + 1
* else it's lines
*/
int
gui_keyboard_get_paste_lines ()
gui_key_get_paste_lines ()
{
if ((gui_keyboard_buffer_size > 0)
&& (gui_keyboard_buffer[gui_keyboard_buffer_size - 1] != 13))
return gui_keyboard_paste_lines + 1;
if ((gui_key_buffer_size > 0)
&& (gui_key_buffer[gui_key_buffer_size - 1] != 13))
return gui_key_paste_lines + 1;
return gui_keyboard_paste_lines;
return gui_key_paste_lines;
}
/*
* gui_keyboard_paste_accept: accept paste from user
* gui_key_paste_accept: accept paste from user
*/
void
gui_keyboard_paste_accept ()
gui_key_paste_accept ()
{
gui_keyboard_paste_pending = 0;
gui_input_paste_pending_signal ();
}
/*
* gui_keyboard_paste_cancel: cancel paste from user (reset buffer)
*/
void
gui_keyboard_paste_cancel ()
{
gui_keyboard_buffer_reset ();
gui_keyboard_paste_pending = 0;
gui_key_paste_pending = 0;
gui_input_paste_pending_signal ();
}
/*
* gui_keyboard_end: end keyboard (free some data)
* gui_key_paste_cancel: cancel paste from user (reset buffer)
*/
void
gui_keyboard_end ()
gui_key_paste_cancel ()
{
/* free keyboard buffer */
if (gui_keyboard_buffer)
free (gui_keyboard_buffer);
/* free all keys */
gui_keyboard_free_all (&gui_keys, &last_gui_key, &gui_keys_count);
/* free all default keys */
gui_keyboard_free_all (&gui_default_keys, &last_gui_default_key,
&gui_default_keys_count);
gui_key_buffer_reset ();
gui_key_paste_pending = 0;
gui_input_paste_pending_signal ();
}
/*
* gui_keyboard_hdata_key_cb: return hdata for key
* gui_key_end: end keyboard (free some data)
*/
void
gui_key_end ()
{
int i;
/* free key buffer */
if (gui_key_buffer)
free (gui_key_buffer);
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
/* free keys */
gui_key_free_all (&gui_keys[i], &last_gui_key[i],
&gui_keys_count[i]);
/* free default keys */
gui_key_free_all (&gui_default_keys[i], &last_gui_default_key[i],
&gui_default_keys_count[i]);
}
}
/*
* gui_key_hdata_key_cb: return hdata for key
*/
struct t_hdata *
gui_keyboard_hdata_key_cb (void *data, const char *hdata_name)
gui_key_hdata_key_cb (void *data, const char *hdata_name)
{
struct t_hdata *hdata;
@@ -775,13 +849,12 @@ gui_keyboard_hdata_key_cb (void *data, const char *hdata_name)
}
/*
* gui_keyboard_add_to_infolist: add a key in an infolist
* return 1 if ok, 0 if error
* gui_key_add_to_infolist: add a key in an infolist
* return 1 if ok, 0 if error
*/
int
gui_keyboard_add_to_infolist (struct t_infolist *infolist,
struct t_gui_key *key)
gui_key_add_to_infolist (struct t_infolist *infolist, struct t_gui_key *key)
{
struct t_infolist_item *ptr_item;
char *expanded_key;
@@ -795,7 +868,7 @@ gui_keyboard_add_to_infolist (struct t_infolist *infolist,
if (!infolist_new_var_string (ptr_item, "key_internal", key->key))
return 0;
expanded_key = gui_keyboard_get_expanded_name (key->key);
expanded_key = gui_key_get_expanded_name (key->key);
if (expanded_key)
{
if (!infolist_new_var_string (ptr_item, "key", expanded_key))
@@ -809,34 +882,49 @@ gui_keyboard_add_to_infolist (struct t_infolist *infolist,
}
/*
* gui_keyboard_print_log: print key infos in log (usually for crash dump)
* gui_key_print_log: print key infos in log (usually for crash dump)
*/
void
gui_keyboard_print_log (struct t_gui_buffer *buffer)
gui_key_print_log (struct t_gui_buffer *buffer)
{
struct t_gui_key *ptr_keys, *ptr_last_key, *ptr_key;
int keys_count;
char prefix[32];
struct t_gui_key *ptr_key;
int i;
ptr_keys = (buffer) ? buffer->keys : gui_keys;
ptr_last_key = (buffer) ? buffer->last_key : last_gui_key;
keys_count = (buffer) ? buffer->keys_count : gui_keys_count;
snprintf (prefix, sizeof (prefix), "%s", (buffer) ? " " : "");
log_printf ("%skeys . . . . . . . . : 0x%lx", prefix, ptr_keys);
log_printf ("%slast_key . . . . . . : 0x%lx", prefix, ptr_last_key);
log_printf ("%skeys_count . . . . . : %d", prefix, keys_count);
for (ptr_key = (buffer) ? buffer->keys : gui_keys; ptr_key;
ptr_key = ptr_key->next_key)
if (buffer)
{
log_printf ("");
log_printf ("%s[key (addr:0x%lx)]", prefix, ptr_key);
log_printf ("%s key. . . . . . . . : '%s'", prefix, ptr_key->key);
log_printf ("%s command. . . . . . : '%s'", prefix, ptr_key->command);
log_printf ("%s prev_key . . . . . : 0x%lx", prefix, ptr_key->prev_key);
log_printf ("%s next_key . . . . . : 0x%lx", prefix, ptr_key->next_key);
log_printf (" keys . . . . . . . . : 0x%lx", buffer->keys);
log_printf (" last_key . . . . . . : 0x%lx", buffer->last_key);
log_printf (" keys_count . . . . . : %d", buffer->keys_count);
for (ptr_key = buffer->keys; ptr_key; ptr_key = ptr_key->next_key)
{
log_printf ("");
log_printf (" [key (addr:0x%lx)]", ptr_key);
log_printf (" key. . . . . . . . : '%s'", ptr_key->key);
log_printf (" command. . . . . . : '%s'", ptr_key->command);
log_printf (" prev_key . . . . . : 0x%lx", ptr_key->prev_key);
log_printf (" next_key . . . . . : 0x%lx", ptr_key->next_key);
}
}
else
{
for (i = 0; i < GUI_KEY_NUM_CONTEXTS; i++)
{
log_printf ("[keys for context: %s]", gui_key_context_string[i]);
log_printf ("");
log_printf (" keys . . . . . . . . : 0x%lx", gui_keys[i]);
log_printf (" last_key . . . . . . : 0x%lx", last_gui_key[i]);
log_printf (" keys_count . . . . . : %d", gui_keys_count[i]);
for (ptr_key = gui_keys[i]; ptr_key; ptr_key = ptr_key->next_key)
{
log_printf ("");
log_printf ("[key (addr:0x%lx)]", ptr_key);
log_printf (" key. . . . . . . . : '%s'", ptr_key->key);
log_printf (" command. . . . . . : '%s'", ptr_key->command);
log_printf (" prev_key . . . . . : 0x%lx", ptr_key->prev_key);
log_printf (" next_key . . . . . : 0x%lx", ptr_key->next_key);
}
}
}
}
+105
View File
@@ -0,0 +1,105 @@
/*
* Copyright (C) 2003-2011 Sebastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WEECHAT_GUI_KEY_H
#define __WEECHAT_GUI_KEY_H 1
#define GUI_KEY_BUFFER_BLOCK_SIZE 256
enum t_gui_key_context
{
GUI_KEY_CONTEXT_DEFAULT = 0,
GUI_KEY_CONTEXT_SEARCH,
/* number of key contexts */
GUI_KEY_NUM_CONTEXTS,
};
/* key structures */
struct t_gui_key
{
char *key; /* key combo (ex: a, ^W, ^W^C, meta-a) */
char *command; /* associated command (may be NULL) */
struct t_gui_key *prev_key; /* link to previous key */
struct t_gui_key *next_key; /* link to next key */
};
/* key variables */
extern struct t_gui_key *gui_keys[GUI_KEY_NUM_CONTEXTS];
extern struct t_gui_key *last_gui_key[GUI_KEY_NUM_CONTEXTS];
extern struct t_gui_key *gui_default_keys[GUI_KEY_NUM_CONTEXTS];
extern struct t_gui_key *last_gui_default_key[GUI_KEY_NUM_CONTEXTS];
extern int gui_keys_count[GUI_KEY_NUM_CONTEXTS];
extern int gui_default_keys_count[GUI_KEY_NUM_CONTEXTS];
extern char *gui_key_context_string[GUI_KEY_NUM_CONTEXTS];
extern int gui_key_verbose;
extern char gui_key_combo_buffer[];
extern int gui_key_grab;
extern int gui_key_grab_count;
extern int *gui_key_buffer;
extern int gui_key_buffer_size;
extern int gui_key_paste_pending;
extern time_t gui_key_last_activity_time;
/* key functions */
extern void gui_key_init ();
extern int gui_key_search_context (const char *context);
extern void gui_key_grab_init (int grab_command);
extern void gui_key_grab_end ();
extern char *gui_key_get_internal_code (const char *key);
extern char *gui_key_get_expanded_name (const char *key);
extern struct t_gui_key *gui_key_new (struct t_gui_buffer *buffer,
int context,
const char *key,
const char *command);
extern struct t_gui_key *gui_key_search (struct t_gui_key *keys,
const char *key);
extern struct t_gui_key *gui_key_bind (struct t_gui_buffer *buffer,
int context,
const char *key,
const char *command);
extern int gui_key_unbind (struct t_gui_buffer *buffer, int context,
const char *key, int send_signal);
extern int gui_key_pressed (const char *key_str);
extern void gui_key_free (struct t_gui_key **keys,
struct t_gui_key **last_key,
int *keys_count,
struct t_gui_key *key);
extern void gui_key_free_all (struct t_gui_key **keys,
struct t_gui_key **last_key,
int *keys_count);
extern void gui_key_buffer_reset ();
extern void gui_key_buffer_add (unsigned char key);
extern int gui_key_get_paste_lines ();
extern void gui_key_paste_accept ();
extern void gui_key_paste_cancel ();
extern void gui_key_end ();
extern struct t_hdata *gui_key_hdata_key_cb (void *data,
const char *hdata_name);
extern int gui_key_add_to_infolist (struct t_infolist *infolist,
struct t_gui_key *key);
extern void gui_key_print_log (struct t_gui_buffer *buffer);
/* key functions (GUI dependent) */
extern void gui_key_default_bindings ();
#endif /* __WEECHAT_GUI_KEY_H */
-93
View File
@@ -1,93 +0,0 @@
/*
* Copyright (C) 2003-2011 Sebastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WEECHAT_GUI_KEYBOARD_H
#define __WEECHAT_GUI_KEYBOARD_H 1
#define GUI_KEYBOARD_BUFFER_BLOCK_SIZE 256
/* keyboard structures */
struct t_gui_key
{
char *key; /* key combo (ex: a, ^W, ^W^C, meta-a) */
char *command; /* associated command (may be NULL) */
struct t_gui_key *prev_key; /* link to previous key */
struct t_gui_key *next_key; /* link to next key */
};
/* keyboard variables */
extern struct t_gui_key *gui_keys;
extern struct t_gui_key *last_gui_key;
extern struct t_gui_key *gui_default_keys;
extern struct t_gui_key *last_gui_default_key;
extern int gui_keys_count;
extern int gui_default_keys_count;
extern int gui_keyboard_verbose;
extern char gui_key_combo_buffer[];
extern int gui_key_grab;
extern int gui_key_grab_count;
extern int *gui_keyboard_buffer;
extern int gui_keyboard_buffer_size;
extern int gui_keyboard_paste_pending;
extern time_t gui_keyboard_last_activity_time;
/* keyboard functions */
extern void gui_keyboard_init ();
extern void gui_keyboard_grab_init (int grab_command);
extern void gui_keyboard_grab_end ();
extern char *gui_keyboard_get_internal_code (const char *key);
extern char *gui_keyboard_get_expanded_name (const char *key);
extern struct t_gui_key *gui_keyboard_new (struct t_gui_buffer *buffer,
const char *key,
const char *command);
extern struct t_gui_key *gui_keyboard_search (struct t_gui_key *keys,
const char *key);
extern struct t_gui_key *gui_keyboard_bind (struct t_gui_buffer *buffer,
const char *key,
const char *command);
extern int gui_keyboard_unbind (struct t_gui_buffer *buffer, const char *key,
int send_signal);
extern int gui_keyboard_pressed (const char *key_str);
extern void gui_keyboard_free (struct t_gui_key **keys,
struct t_gui_key **last_key,
int *keys_count,
struct t_gui_key *key);
extern void gui_keyboard_free_all (struct t_gui_key **keys,
struct t_gui_key **last_key,
int *keys_count);
extern void gui_keyboard_buffer_reset ();
extern void gui_keyboard_buffer_add (unsigned char key);
extern int gui_keyboard_get_paste_lines ();
extern void gui_keyboard_paste_accept ();
extern void gui_keyboard_paste_cancel ();
extern void gui_keyboard_end ();
extern struct t_hdata *gui_keyboard_hdata_key_cb (void *data,
const char *hdata_name);
extern int gui_keyboard_add_to_infolist (struct t_infolist *infolist,
struct t_gui_key *key);
extern void gui_keyboard_print_log (struct t_gui_buffer *buffer);
/* keyboard functions (GUI dependent) */
extern void gui_keyboard_default_bindings ();
#endif /* __WEECHAT_GUI_KEYBOARD_H */
+1
View File
@@ -1099,6 +1099,7 @@ gui_window_scroll_next_highlight (struct t_gui_window *window)
/*
* gui_window_search_text: search text in a buffer
* return 1 if line has been found with text, otherwise 0
*/
int
+14 -8
View File
@@ -53,7 +53,7 @@
#include "../gui/gui-filter.h"
#include "../gui/gui-history.h"
#include "../gui/gui-hotlist.h"
#include "../gui/gui-keyboard.h"
#include "../gui/gui-key.h"
#include "../gui/gui-line.h"
#include "../gui/gui-nicklist.h"
#include "../gui/gui-window.h"
@@ -353,10 +353,10 @@ plugin_api_info_get_internal (void *data, const char *info_name,
}
else if (string_strcasecmp (info_name, "inactivity") == 0)
{
if (gui_keyboard_last_activity_time == 0)
if (gui_key_last_activity_time == 0)
inactivity = 0;
else
inactivity = time (NULL) - gui_keyboard_last_activity_time;
inactivity = time (NULL) - gui_key_last_activity_time;
snprintf (value, sizeof (value), "%ld", (long int)inactivity);
return value;
}
@@ -394,6 +394,7 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
struct t_gui_key *ptr_key;
struct t_weechat_plugin *ptr_plugin;
char buffer_full_name[1024];
int context;
/* make C compiler happy */
(void) data;
@@ -678,12 +679,17 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
ptr_infolist = infolist_new ();
if (ptr_infolist)
{
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
context = gui_key_search_context (arguments);
if (context >= 0)
{
if (!gui_keyboard_add_to_infolist (ptr_infolist, ptr_key))
for (ptr_key = gui_keys[context]; ptr_key;
ptr_key = ptr_key->next_key)
{
infolist_free (ptr_infolist);
return NULL;
if (!gui_key_add_to_infolist (ptr_infolist, ptr_key))
{
infolist_free (ptr_infolist);
return NULL;
}
}
}
return ptr_infolist;
@@ -1074,7 +1080,7 @@ plugin_api_init ()
hook_hdata (NULL, "input_undo", N_("structure with undo for input line"),
&gui_buffer_hdata_input_undo_cb, NULL);
hook_hdata (NULL, "key", N_("a key (keyboard shortcut)"),
&gui_keyboard_hdata_key_cb, NULL);
&gui_key_hdata_key_cb, NULL);
hook_hdata (NULL, "lines", N_("structure with lines"),
&gui_line_hdata_lines_cb, NULL);
hook_hdata (NULL, "line", N_("structure with one line"),