GithubHelp home page GithubHelp logo

customkeyboard's Introduction

CustomKeyBoard

Winform

Start setting

Set the keyboard value by using Dictionary.txt For example: A,B,C,0.....etc

Important! please using command to spearate(default)

 private void Dictionary()
        {
            StreamReader str = new StreamReader(@"C:\Users\Done-02\source\repos\WindowsFormsApp1\WindowsFormsApp1\Dictionary.txt"); // change your own location(where you put the dictionary.txt)
            string ReadAll = str.ReadToEnd();
            str.Close();

            string[] words = ReadAll.Split(','); // using command to spearate

            foreach (var item in words)
            {
                word.Add($"{item}");
            }
        }

You can change keyboardsize / row / controlkeyboard in App.config

<appSettings>
		<add key="keysize" value="50"/>
		<add key="keyrow" value="9"/>
		<add key="controlkey" value="67"/>
</appSettings>

How to use in form

KeyBoard Event

public void SetName(string name, string control)
        {
            //textBox1.Text = name;
            //textBox2.Text = name;

            set.Text = name;  // "set" is using to set which one textbox is focused.

            if (control == "close")
            {
                label1.Focus();
            }
            if (control == "enter")
            {
                // 送出
            }
        }

Open KeyBoard Setting and textBox value set

private void keyboard(TextBox textBox)
        {
            using (var keyBoard = new KeyBoard(this)) // open form by using then can avoid DI problem
            {
                keyBoard.ShowDialog();
                Global.GlobalVar = "";  // using global value to remember the keyboard send value
                set = textBox; // this is set the textBox

                // 阻止他跳出 I not sure how to stop Dialog Disappear so this magic way(not a good way)
                if (keyBoard.ShowDialog() == DialogResult.OK)
                {
                    //someControlOnForm1.Text = form2.TheValue;
                }
            }
        }
private void textBox1_MouseHover_1(object sender, EventArgs e)
        {
            keyboard(textBox1); // send what you want to set the textbox
        }

customkeyboard's People

Contributors

yvelltt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.