api: add special key "__quiet" in function key_bind

v2.8-utf8proc
Sébastien Helleu 2017-03-31 21:04:21 +02:00
parent 85bb23f8cb
commit 36eb3ee343
5 changed files with 38 additions and 9 deletions

View File

@ -7111,7 +7111,7 @@ Functions for key bindings.
==== key_bind
_WeeChat ≥ 0.3.6._
_WeeChat ≥ 0.3.6, updated in 1.8._
Add new key bindings.
@ -7126,6 +7126,8 @@ Prototype:
int weechat_key_bind (const char *context, struct t_hashtable *keys);
----
:key_bind_quiet: __quiet
Arguments:
* _context_: context for keys:
@ -7133,7 +7135,9 @@ Arguments:
** _search_: search context (when searching text in buffer)
** _cursor_: free movement of cursor on screen
** _mouse_: keys for mouse events
* _keys_: hashtable with key bindings
* _keys_: hashtable with key bindings; it can contain following special keys:
** _{key_bind_quiet}_: do not display the keys added in core buffer
_(WeeChat ≥ 1.8)_
Return value:

View File

@ -7221,7 +7221,7 @@ Fonctions pour les associations de touches.
==== key_bind
_WeeChat ≥ 0.3.6._
_WeeChat ≥ 0.3.6, mis à jour dans la 1.8._
Ajouter de nouvelles associations de touches.
@ -7237,6 +7237,8 @@ Prototype :
int weechat_key_bind (const char *context, struct t_hashtable *keys);
----
:key_bind_quiet: __quiet
Paramètres :
* _context_ : contexte pour les touches :
@ -7245,7 +7247,10 @@ Paramètres :
tampon)
** _cursor_ : mouvement libre du curseur à l'écran
** _mouse_ : touches pour les évènements de souris
* _keys_ : table de hachage avec les associations de touches
* _keys_ : table de hachage avec les associations de touches ; elle peut contenir
les clés spéciales suivantes :
** _{key_bind_quiet}_: ne pas afficher les touches ajoutées dans le tampon _core_
_(WeeChat ≥ 1.8)_
Valeur de retour :

View File

@ -7315,7 +7315,8 @@ Funzioni per le combinazioni dei tasti.
==== key_bind
_WeeChat ≥ 0.3.6._
// TRANSLATION MISSING
_WeeChat ≥ 0.3.6, updated in 1.8._
Aggiunge una nuova combinazione tasto.
@ -7331,6 +7332,8 @@ Prototipo:
int weechat_key_bind (const char *context, struct t_hashtable *keys);
----
:key_bind_quiet: __quiet
Argomenti:
* _context_: contesto per i tasti:
@ -7338,7 +7341,10 @@ Argomenti:
** _search_: contesto search (quando si cerca testo nel buffer)
** _cursor_: movimento libero del cursore sullo schermo
** _mouse_: tasti per gli eventi del mouse
* _keys_: tabella hash con le combinazioni dei tasti
// TRANSLATION MISSING
* _keys_: hashtable with key bindings; it can contain following special keys:
** _{key_bind_quiet}_: do not display the keys added in core buffer
_(WeeChat ≥ 1.8)_
Valore restituito:

View File

@ -7119,7 +7119,7 @@ elif rc == weechat.WEECHAT_CONFIG_OPTION_UNSET_ERROR:
==== key_bind
_WeeChat バージョン 0.3.6 以上で利用可。_
_WeeChat バージョン 0.3.6 以上で利用可、バージョン 1.8 で更新。_
新しいキー割り当てを追加。
@ -7135,6 +7135,8 @@ _WeeChat バージョン 0.3.6 以上で利用可。_
int weechat_key_bind (const char *context, struct t_hashtable *keys);
----
:key_bind_quiet: __quiet
引数:
* _context_: キーのコンテキスト:
@ -7142,7 +7144,10 @@ int weechat_key_bind (const char *context, struct t_hashtable *keys);
** _search_: 検索コンテキスト (バッファ中のテキストを検索中)
** _cursor_: 画面上のカーソルを自由に移動
** _mouse_: マウスイベント用のキー
* _keys_: キー割り当てを収めたハッシュテーブル
// TRANSLATION MISSING
* _keys_: hashtable with key bindings; it can contain following special keys:
** _{key_bind_quiet}_: do not display the keys added in core buffer
_(WeeChat ≥ 1.8)_
戻り値:

View File

@ -798,6 +798,10 @@ gui_key_bind_plugin_hashtable_map_cb (void *data,
if (user_data && key && value)
{
/* ignore special key "__quiet" */
if (strcmp (key, "__quiet") == 0)
return;
internal_code = gui_key_get_internal_code (key);
if (internal_code)
{
@ -825,14 +829,19 @@ int
gui_key_bind_plugin (const char *context, struct t_hashtable *keys)
{
int data[2];
const char *ptr_quiet;
data[0] = gui_key_search_context (context);
if (data[0] < 0)
return 0;
gui_key_verbose = 1;
data[1] = 0;
ptr_quiet = hashtable_get (keys, "__quiet");
gui_key_verbose = (ptr_quiet) ? 0 : 1;
hashtable_map (keys, &gui_key_bind_plugin_hashtable_map_cb, data);
gui_key_verbose = 0;
return data[1];