klavaro  3.13
About: Klavaro is a touch typing tutor program.
  Fossies Dox: klavaro-3.13.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

keyboard.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _KEYBLAYOUT
 

Macros

#define KEYB_AUTO_SAVE   "tmp_auto"
 
#define MAX_KEYBOARDS   200
 
#define KEY_LINE_LEN   (14 + 1) /* 14 keys + 1 NULL char */
 
#define UPSYM   ((gunichar) 182)
 
#define URDU_STOP   ((gunichar) 0x06D4)
 
#define URDU_COMMA   ((gunichar) 0x060C)
 
#define DEVANAGARI_STOP   ((gunichar) 0x0964)
 
#define TIBETAN_WORD_DELIMITER   ((gunichar) 0x0F0B)
 
#define TIBETAN_STOP   ((gunichar) 0x0F0D)
 
#define TIBETAN_COMMA   ((gunichar) L' ')
 
#define BO_NARO   ((gunichar) 0x0F7C)
 
#define KEYB_GREEN   "#aaeebb"
 
#define KEYB_RED   "#eeaaaa"
 
#define KEYB_BLUE   "#bbbbff"
 
#define KEYB_YELLOW   "#eeee88"
 
#define KEYB_ORANGE   "#ffcc77" /* "#ffdd88" */
 
#define KEYB_PURPLE   "#ccaacc"
 
#define KEYB_BLACK   "#000000"
 

Typedefs

typedef struct _KEYBLAYOUT KeybLayout
 

Functions

gchar * keyb_get_name (void)
 
gchar * keyb_get_name_last (void)
 
void keyb_set_name (const gchar *name)
 
void keyb_init_name (const gchar *name)
 
gunichar keyb_get_lochars (gint i, gint j)
 
gunichar keyb_get_upchars (gint i, gint j)
 
gboolean keyb_get_modified_status (void)
 
void keyb_set_modified_status (gboolean new_status)
 
void keyb_create_virtual_keys (void)
 
void keyb_set_chars (void)
 
gboolean keyb_is_vowel (gunichar chr)
 
gboolean keyb_is_diacritic (gunichar chr)
 
gboolean keyb_is_inset (gunichar chr)
 
gint keyb_get_vowels (gunichar *vows)
 
gint keyb_get_consonants (gunichar *consonants)
 
gint keyb_get_symbols (gunichar *symbols)
 
gint keyb_get_altnums (gunichar *altnums)
 
gunichar keyb_unichar_toupper (gunichar uchar)
 
void keyb_save_new_layout (void)
 
void keyb_remove_user_layout (void)
 
void keyb_update_virtual_layout (void)
 
gchar * keyb_get_country_code (const gchar *kbd)
 
gchar * keyb_get_country (const gchar *kbd)
 
gchar * keyb_get_variant (const gchar *kbd)
 
void keyb_set_keyboard_layouts (void)
 
void keyb_update_from_variant (gchar *cmb_country, gchar *cmb_variant)
 
void keyb_set_combo_kbd_variant (gchar *cmb_country, gchar *cmb_variant)
 
void keyb_set_combo_kbd (gchar *cmb_country, gchar *cmb_variant)
 
void keyb_update_combos (gchar *cmb_country, gchar *cmb_variant)
 
void keyb_intro_step_next (void)
 
void keyb_intro_step_previous (void)
 
void keyb_intro_step (gint step)
 
gchar * keyb_mode_get_name (void)
 
void keyb_mode_intro (void)
 
void keyb_mode_hint (void)
 
void keyb_mode_edit (void)
 
void keyb_set_sensitive (gboolean state)
 
gboolean keyb_button_match (GtkButton *button)
 
void keyb_edit_button (GtkButton *button)
 
void keyb_edit_none (void)
 
gboolean keyb_edit_next (void)
 
void keyb_change_key (gunichar real_key)
 
gchar * keyb_get_utf8_paragraph_symbol (void)
 
gboolean keyb_force_edit_tab (gpointer data)
 
void hints_init (void)
 
gchar * hints_color_from_charcode (gchar charcode)
 
gchar * hints_string_from_charcode (gchar charcode)
 
void hints_set_tips (void)
 
void hints_set_colors (void)
 
void hints_get_from_char (gchar *file_name, gunichar character)
 
void hints_update_from_char (gunichar character)
 
void hints_update_from_button (GtkButton *button)
 
gboolean hints_demo_fingers_move (gpointer data)
 
void hints_demo_fingers (guint msec)
 
gchar * hints_finger_name_from_char (gunichar uch)
 

Macro Definition Documentation

◆ BO_NARO

#define BO_NARO   ((gunichar) 0x0F7C)

Definition at line 30 of file keyboard.h.

◆ DEVANAGARI_STOP

#define DEVANAGARI_STOP   ((gunichar) 0x0964)

Definition at line 26 of file keyboard.h.

◆ KEY_LINE_LEN

#define KEY_LINE_LEN   (14 + 1) /* 14 keys + 1 NULL char */

Definition at line 21 of file keyboard.h.

◆ KEYB_AUTO_SAVE

#define KEYB_AUTO_SAVE   "tmp_auto"

Definition at line 18 of file keyboard.h.

◆ KEYB_BLACK

#define KEYB_BLACK   "#000000"

Definition at line 40 of file keyboard.h.

◆ KEYB_BLUE

#define KEYB_BLUE   "#bbbbff"

Definition at line 36 of file keyboard.h.

◆ KEYB_GREEN

#define KEYB_GREEN   "#aaeebb"

Definition at line 34 of file keyboard.h.

◆ KEYB_ORANGE

#define KEYB_ORANGE   "#ffcc77" /* "#ffdd88" */

Definition at line 38 of file keyboard.h.

◆ KEYB_PURPLE

#define KEYB_PURPLE   "#ccaacc"

Definition at line 39 of file keyboard.h.

◆ KEYB_RED

#define KEYB_RED   "#eeaaaa"

Definition at line 35 of file keyboard.h.

◆ KEYB_YELLOW

#define KEYB_YELLOW   "#eeee88"

Definition at line 37 of file keyboard.h.

◆ MAX_KEYBOARDS

#define MAX_KEYBOARDS   200

Definition at line 20 of file keyboard.h.

◆ TIBETAN_COMMA

#define TIBETAN_COMMA   ((gunichar) L' ')

Definition at line 29 of file keyboard.h.

◆ TIBETAN_STOP

#define TIBETAN_STOP   ((gunichar) 0x0F0D)

Definition at line 28 of file keyboard.h.

◆ TIBETAN_WORD_DELIMITER

#define TIBETAN_WORD_DELIMITER   ((gunichar) 0x0F0B)

Definition at line 27 of file keyboard.h.

◆ UPSYM

#define UPSYM   ((gunichar) 182)

Definition at line 23 of file keyboard.h.

◆ URDU_COMMA

#define URDU_COMMA   ((gunichar) 0x060C)

Definition at line 25 of file keyboard.h.

◆ URDU_STOP

#define URDU_STOP   ((gunichar) 0x06D4)

Definition at line 24 of file keyboard.h.

Typedef Documentation

◆ KeybLayout

typedef struct _KEYBLAYOUT KeybLayout

Function Documentation

◆ hints_color_from_charcode()

gchar* hints_color_from_charcode ( gchar  charcode)

◆ hints_demo_fingers()

void hints_demo_fingers ( guint  msec)

◆ hints_demo_fingers_move()

gboolean hints_demo_fingers_move ( gpointer  data)

Definition at line 1952 of file keyboard.c.

References data, i, keyb, and keyb_edit_next().

Referenced by hints_demo_fingers().

◆ hints_finger_name_from_char()

gchar* hints_finger_name_from_char ( gunichar  uch)

Definition at line 1987 of file keyboard.c.

References hints, hints_init(), hints_string_from_charcode(), i, j, keyb, and UPSYM.

Referenced by tutor_delayed_finger_tip().

◆ hints_get_from_char()

void hints_get_from_char ( gchar *  file_name,
gunichar  character 
)

◆ hints_init()

◆ hints_set_colors()

void hints_set_colors ( void  )

Definition at line 1848 of file keyboard.c.

References hints, hints_is_initialized, i, j, KEY_LINE_LEN, keyb, and keyb_css.

Referenced by hints_init().

◆ hints_set_tips()

void hints_set_tips ( void  )

◆ hints_string_from_charcode()

gchar* hints_string_from_charcode ( gchar  charcode)

Definition at line 1707 of file keyboard.c.

References _.

Referenced by hints_finger_name_from_char(), and hints_set_tips().

◆ hints_update_from_button()

void hints_update_from_button ( GtkButton *  button)

◆ hints_update_from_char()

void hints_update_from_char ( gunichar  character)

Definition at line 1911 of file keyboard.c.

References get_wg(), hints, hints_init(), i, j, keyb, set_pixmap(), and UPSYM.

Referenced by on_button_keyboard_hands_clicked(), and tutor_process_touch().

◆ keyb_button_match()

gboolean keyb_button_match ( GtkButton *  button)

Definition at line 1506 of file keyboard.c.

References i, j, KEY_LINE_LEN, and keyb.

Referenced by hints_update_from_button(), and keyb_edit_button().

◆ keyb_change_key()

void keyb_change_key ( gunichar  real_key)

Apply the key pressed to the virtual keyboard and to the upper or lower character sets

Definition at line 1609 of file keyboard.c.

References get_wg(), keyb, and keyb_set_modified_status().

Referenced by on_virtual_key_changed().

◆ keyb_create_virtual_keys()

◆ keyb_edit_button()

void keyb_edit_button ( GtkButton *  button)

Moves the entry widget to get a real key pressed and writes the name of the virtual one.

Definition at line 1532 of file keyboard.c.

References callbacks_shield_set(), get_wg(), KEY_DX, KEY_DY, keyb, keyb_button_match(), and x0.

Referenced by on_virtual_key_clicked(), and on_virtual_key_grab_focus().

◆ keyb_edit_next()

gboolean keyb_edit_next ( void  )

Definition at line 1563 of file keyboard.c.

References keyb.

Referenced by hints_demo_fingers_move().

◆ keyb_edit_none()

◆ keyb_force_edit_tab()

gboolean keyb_force_edit_tab ( gpointer  data)

◆ keyb_get_altnums()

gint keyb_get_altnums ( gunichar *  altnums)

Get the set of available non-arabic digits in the keyboard

Definition at line 567 of file keyboard.c.

References i, j, KEY_LINE_LEN, and keyb.

Referenced by adapt_create_number().

◆ keyb_get_consonants()

gint keyb_get_consonants ( gunichar *  consonants)

Get the set of available consonants of the keyboard

Definition at line 518 of file keyboard.c.

References i, j, KEY_LINE_LEN, keyb, and keyb_is_vowel().

Referenced by adapt_create_word().

◆ keyb_get_country()

gchar* keyb_get_country ( const gchar *  kbd)

Definition at line 758 of file keyboard.c.

References keyb_get_country_code(), and trans_code_to_country().

Referenced by keyb_set_keyboard_layouts(), and keyb_update_combos().

◆ keyb_get_country_code()

gchar* keyb_get_country_code ( const gchar *  kbd)

Definition at line 740 of file keyboard.c.

Referenced by keyb_get_country(), and tutor_is_tibetan().

◆ keyb_get_lochars()

gunichar keyb_get_lochars ( gint  i,
gint  j 
)

Definition at line 232 of file keyboard.c.

References i, j, and keyb.

Referenced by basic_init_char_set().

◆ keyb_get_modified_status()

gboolean keyb_get_modified_status ( void  )

Definition at line 244 of file keyboard.c.

References keyb.

◆ keyb_get_name()

◆ keyb_get_name_last()

gchar* keyb_get_name_last ( void  )

Definition at line 210 of file keyboard.c.

References keyb.

◆ keyb_get_symbols()

gint keyb_get_symbols ( gunichar *  symbols)

Get the set of available symbols of the keyboard

Definition at line 543 of file keyboard.c.

References i, j, KEY_LINE_LEN, and keyb.

Referenced by adapt_create_word(), and fluid_filter_utf8().

◆ keyb_get_upchars()

gunichar keyb_get_upchars ( gint  i,
gint  j 
)

Definition at line 238 of file keyboard.c.

References i, j, and keyb.

Referenced by basic_init_char_set().

◆ keyb_get_utf8_paragraph_symbol()

gchar* keyb_get_utf8_paragraph_symbol ( void  )

Get an utf8 string for the par symbol

Definition at line 1649 of file keyboard.c.

References UPSYM.

Referenced by basic_draw_lesson(), on_entry_mesg_activate(), and tutor_draw_paragraph().

◆ keyb_get_variant()

gchar* keyb_get_variant ( const gchar *  kbd)

Definition at line 773 of file keyboard.c.

Referenced by keyb_set_combo_kbd_variant(), and keyb_set_keyboard_layouts().

◆ keyb_get_vowels()

gint keyb_get_vowels ( gunichar *  vows)

Get the set of available vowels of the keyboard

Definition at line 491 of file keyboard.c.

References i, j, KEY_LINE_LEN, keyb, keyb_is_diacritic(), and keyb_is_vowel().

Referenced by accur_create_word(), and adapt_create_word().

◆ keyb_init_name()

void keyb_init_name ( const gchar *  name)

Definition at line 225 of file keyboard.c.

References keyb, and name.

Referenced by keyb_set_combo_kbd().

◆ keyb_intro_step()

void keyb_intro_step ( gint  step)

◆ keyb_intro_step_next()

void keyb_intro_step_next ( void  )

Definition at line 1148 of file keyboard.c.

References keyb, and keyb_intro_step().

Referenced by on_button_keyboard_next_clicked().

◆ keyb_intro_step_previous()

void keyb_intro_step_previous ( void  )

Definition at line 1155 of file keyboard.c.

References keyb, and keyb_intro_step().

Referenced by on_button_keyboard_previous_clicked().

◆ keyb_is_diacritic()

gboolean keyb_is_diacritic ( gunichar  chr)

Test if chr is a diacritic character

Definition at line 476 of file keyboard.c.

References diacritics, and i.

Referenced by accur_create_word(), adapt_create_word(), basic_draw_lesson(), and keyb_get_vowels().

◆ keyb_is_inset()

gboolean keyb_is_inset ( gunichar  chr)

Test if chr belongs to the current key set

Definition at line 442 of file keyboard.c.

References i, j, KEY_LINE_LEN, and keyb.

Referenced by accur_correct(), and accur_wrong().

◆ keyb_is_vowel()

gboolean keyb_is_vowel ( gunichar  chr)

Test if chr is a vowel

Definition at line 462 of file keyboard.c.

References i, and vowels.

Referenced by basic_draw_lesson(), keyb_get_consonants(), and keyb_get_vowels().

◆ keyb_mode_edit()

◆ keyb_mode_get_name()

gchar* keyb_mode_get_name ( void  )

Definition at line 1358 of file keyboard.c.

References get_wg().

Referenced by keyb_mode_hint(), keyb_mode_intro(), and on_combobox_stat_module_changed().

◆ keyb_mode_hint()

◆ keyb_mode_intro()

void keyb_mode_intro ( void  )

◆ keyb_remove_user_layout()

void keyb_remove_user_layout ( void  )

Remove custom keyboard layout created by the user

Definition at line 640 of file keyboard.c.

References callbacks_shield_set(), get_wg(), keyb_set_keyboard_layouts(), and main_path_user().

Referenced by on_button_confirm_yes_clicked().

◆ keyb_save_new_layout()

void keyb_save_new_layout ( void  )

Save the custom keyboard layout created by the user

Definition at line 608 of file keyboard.c.

References assert_user_dir(), i, KEY_LINE_LEN, keyb, keyb_set_modified_status(), and main_path_user().

Referenced by on_button_confirm_yes_clicked().

◆ keyb_set_chars()

void keyb_set_chars ( void  )

Read the character sets (keyb.lochars[] & keyb.upchars[]) for the keyboard currently selected.

Definition at line 361 of file keyboard.c.

References i, KEY_LINE_LEN, keyb, keyb_set_modified_status(), keyb_set_name(), main_path_data(), main_path_user(), main_preferences_remove(), main_preferences_set_string(), and trans_get_default_keyboard().

Referenced by keyb_set_combo_kbd(), keyb_update_from_variant(), and on_button_keyboard_cancel_clicked().

◆ keyb_set_combo_kbd()

◆ keyb_set_combo_kbd_variant()

void keyb_set_combo_kbd_variant ( gchar *  cmb_country,
gchar *  cmb_variant 
)

◆ keyb_set_keyboard_layouts()

◆ keyb_set_modified_status()

void keyb_set_modified_status ( gboolean  new_status)

◆ keyb_set_name()

void keyb_set_name ( const gchar *  name)

◆ keyb_set_sensitive()

void keyb_set_sensitive ( gboolean  state)

Definition at line 1489 of file keyboard.c.

References get_wg(), i, j, KEY_LINE_LEN, and keyb.

Referenced by keyb_intro_step(), and keyb_mode_edit().

◆ keyb_unichar_toupper()

gunichar keyb_unichar_toupper ( gunichar  uchar)

Get the upper case of a letter, only if it's included in the keyboard (by shift)

Definition at line 591 of file keyboard.c.

References i, j, KEY_LINE_LEN, and keyb.

Referenced by adapt_create_word(), and adapt_draw_random_pattern().

◆ keyb_update_combos()

void keyb_update_combos ( gchar *  cmb_country,
gchar *  cmb_variant 
)

◆ keyb_update_from_variant()

void keyb_update_from_variant ( gchar *  cmb_country,
gchar *  cmb_variant 
)

◆ keyb_update_virtual_layout()

void keyb_update_virtual_layout ( void  )

Update the virtual keyboard accordingly to its character set and shift key state.

Definition at line 671 of file keyboard.c.

References get_wg(), i, j, KEY_LINE_LEN, and keyb.

Referenced by keyb_mode_edit(), keyb_mode_hint(), keyb_mode_intro(), keyb_update_from_variant(), on_toggle_shift1_toggled(), and on_toggle_shift2_toggled().