GithubHelp home page GithubHelp logo

imedemo's Introduction

IMEDemo


键盘输入简单demo


static Random rand = new Random();
	public static boolean humanTypeString_zidong(Activity activity,String title) {
		
		while (!setVPN.getSharedPreferencesBoolean(activity, "keyboardState")) {
			baseCmd.Wait(2000);
			Log.e("wodelog", "继续等待键盘");
			Nexus5Touch.Tap(322, 685);// 点击用户名
		}
		
		int randNumfor = rand.nextInt(5)+1;
		
		for (int i = 0; i < randNumfor; i++) {
			int randNum = rand.nextInt(SoftKeyboard.mLetterList1111.length-1);
			int jcode = SoftKeyboard.mLetterList1111[randNum];
			Log.i("CMD", "人工输入字符串:" + (char)jcode);
			SoftKeyboard.touchKeyByKeyCode(jcode);
					}
		
		 Intent intent = new Intent("com.ime.input");
		 intent.putExtra("input", title);
		 intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
		 activity.sendBroadcast(intent);
		return true;
	}

imedemo's People

Contributors

xusoku avatar

Watchers

 avatar  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.