示例#1
0
 public void t入力を開始(bool bWithShow = true)
 {
     CDTXMania.app.cIMEHook.Focus();
     if (ctカーソル != null)
     {
         ctカーソル.tUpdateLoop();
         ctカーソル.nCurrentValue = 1;
     }
     b次のフレームで入力中にする = true;
     CDTXMania.app.textboxテキスト入力中 = this;
     if (bWithShow)
     {
         t表示();
         b入力終了時に非表示にする = true;
     }
 }
示例#2
0
 public override int OnUpdateAndDraw()
 {
     if (base.bNotActivated)
     {
         return(0);
     }
     if (b表示中)
     {
         tx背景?.tDraw2D(CDTXMania.app.Device, rectパネル基本位置.X, rectパネル基本位置.Y);
         if (b入力中)
         {
             bool flag = false;
             if (bIME取得可能)
             {
                 strIME入力中文字列_前フレーム = strIME入力中文字列;
                 strIME入力中文字列       = CDTXMania.app.cIMEHook.str入力中文字列;
                 strIME確定文字列        = CDTXMania.app.cIMEHook.str確定文字列;
                 if (strIME入力中文字列 != strIME入力中文字列_前フレーム)
                 {
                     flag = true;
                 }
                 if (strIME確定文字列 != "")
                 {
                     if (strIME確定文字列 != strIME確定文字列_前回)
                     {
                         t入力中文字列のカーソル位置に文字を挿入する(strIME確定文字列);
                         bIME確定文字列を入力した直後 = true;
                         flag             = true;
                         strIME確定文字列_前回   = strIME確定文字列;
                     }
                     else
                     {
                         bIME確定文字列を入力した直後 = false;
                     }
                 }
             }
             if (CDTXMania.InputManager.Keyboard.bKeyPressed(117) || CDTXMania.InputManager.Keyboard.bKeyPressed(100))
             {
                 if (!bIME確定文字列を入力した直後)
                 {
                     t入力を確定して終了();
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(53))
             {
                 if (strIME入力中文字列_前フレーム == "")
                 {
                     t入力を確定せずに終了();
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(31))
             {
                 if ((CDTXMania.InputManager.Keyboard.bKeyPressing(75) || CDTXMania.InputManager.Keyboard.bKeyPressing(116)) && strIME入力中文字列 == "")
                 {
                     string text = tクリップボードから文字列を取得する().Replace("\r\n", "");
                     if (text != string.Empty)
                     {
                         str入力中文字列 = str入力中文字列.Substring(0, nカーソル位置) + text + str入力中文字列.Substring(nカーソル位置);
                         nカーソル位置  += text.Length;
                         flag      = true;
                     }
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(12))
             {
                 if ((CDTXMania.InputManager.Keyboard.bKeyPressing(75) || CDTXMania.InputManager.Keyboard.bKeyPressing(116)) && strIME入力中文字列 == "")
                 {
                     tクリップボードに文字列を設定する(str入力中文字列);
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(10))
             {
                 if ((CDTXMania.InputManager.Keyboard.bKeyPressing(75) || CDTXMania.InputManager.Keyboard.bKeyPressing(116)) && strIME入力中文字列 == "")
                 {
                     str入力中文字列 = "";
                     nカーソル位置   = 0;
                     flag      = true;
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(76))
             {
                 if (strIME入力中文字列 == "")
                 {
                     nカーソル位置--;
                     if (nカーソル位置 < 0)
                     {
                         nカーソル位置 = 0;
                     }
                     flag = true;
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(118))
             {
                 if (strIME入力中文字列 == "")
                 {
                     nカーソル位置++;
                     if (nカーソル位置 > str入力中文字列.Length)
                     {
                         nカーソル位置 = str入力中文字列.Length;
                     }
                     flag = true;
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(132))
             {
                 if (strIME入力中文字列 == "" && L前回確定した文字列リスト.Count > 0)
                 {
                     n前回確定した文字列リスト_参照カウンタ--;
                     if (n前回確定した文字列リスト_参照カウンタ < 0)
                     {
                         n前回確定した文字列リスト_参照カウンタ = 0;
                     }
                     str入力中文字列 = L前回確定した文字列リスト[n前回確定した文字列リスト_参照カウンタ];
                     nカーソル位置   = str入力中文字列.Length;
                     flag      = true;
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(50))
             {
                 if (strIME入力中文字列 == "" && L前回確定した文字列リスト.Count > 0)
                 {
                     n前回確定した文字列リスト_参照カウンタ++;
                     if (n前回確定した文字列リスト_参照カウンタ >= L前回確定した文字列リスト.Count)
                     {
                         n前回確定した文字列リスト_参照カウンタ = L前回確定した文字列リスト.Count;
                         str入力中文字列            = "";
                     }
                     else
                     {
                         str入力中文字列 = L前回確定した文字列リスト[n前回確定した文字列リスト_参照カウンタ];
                     }
                     nカーソル位置 = str入力中文字列.Length;
                     flag    = true;
                 }
             }
             else if (CDTXMania.InputManager.Keyboard.bKeyPressed(49))
             {
                 if (strIME入力中文字列 == "")
                 {
                     if (nカーソル位置 < str入力中文字列.Length)
                     {
                         str入力中文字列 = str入力中文字列.Substring(0, nカーソル位置) + str入力中文字列.Substring(nカーソル位置 + 1);
                     }
                     flag = true;
                 }
             }
             else
             {
                 _ = (strIME入力中文字列 == "");
             }
             if (flag)
             {
                 t文字テクスチャを生成();
             }
             ctカーソル?.tUpdateLoop();
             CCounter cCounter = ctカーソル;
             if (cCounter != null && cCounter.nCurrentValue <= 500)
             {
                 txカーソル?.tDraw2D(CDTXMania.app.Device, rectパネル基本位置.X + nカーソル座標X, rectパネル基本位置.Y + 2);
             }
             if (b検索説明文表示)
             {
                 tx説明?.tDraw2D(CDTXMania.app.Device, rectパネル基本位置.X, rectパネル基本位置.Y + 60);
             }
         }
         tx文字列?.tDraw2D(CDTXMania.app.Device, rectパネル基本位置.X, rectパネル基本位置.Y);
     }
     if (b次のフレームで入力中にする)
     {
         b入力中           = true;
         b次のフレームで入力中にする = false;
     }
     return(0);
 }