Пример #1
0
 /// <summary>
 /// 指定したキーの入力する数を取得する
 /// </summary>
 /// <param name="key">キー</param>
 /// <returns>入力する数</returns>
 public int get_number(char key)
 {
     for (int i = 0; i < char_setting_list.Count; i++)
     {
         CharItem item = (CharItem)char_setting_list[i];
         if (item.Key == key)
         {
             return(item.Number);
         }
     }
     return(0);
 }
Пример #2
0
 /// <summary>
 /// 指定したキーの動作を取得する
 /// </summary>
 /// <param name="key">キー</param>
 /// <returns>動作</returns>
 public KeyAction get_action(char key)
 {
     System.Diagnostics.Debug.WriteLine("get_action " + Convert.ToString(key));
     for (int i = 0; i < char_setting_list.Count; i++)
     {
         CharItem item = (CharItem)char_setting_list[i];
         if (item.Key == key)
         {
             return(item.Action);
         }
     }
     return(KeyAction.None);
 }
Пример #3
0
 /// <summary>
 /// 指定したキーに動作と数を指定する
 /// </summary>
 /// <param name="key">キー</param>
 /// <param name="action">動作</param>
 /// <param name="number">数</param>
 private void set_action(char key, KeyAction action, int number)
 {
     for (int i = 0; i < char_setting_list.Count; i++)
     {
         CharItem item = (CharItem)char_setting_list[i];
         if (item.Key == key)
         {
             item.Action = action;
             item.Number = number;
             return;
         }
     }
     char_setting_list.Add(new CharItem(key, action, number, false));
 }