GithubHelp home page GithubHelp logo

system-key-config-runtime's Introduction

SystemKeyConfig

JAR file, demo apk are in /resource.
Note:

Introduction

This JAR file is used to config system home key

Modify AndroidManifest

Add Manifest tag

android:sharedUserId="android.uid.system"

Add permissions

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

ClassName

android:name="com.picovr.picokeyconfig.SystemKeyConfigClass"

Interface

void setUserKeyConfig()  //Set user custom key configuration.
void setDefaultKeyConfig()  //Set key config to default.

Permission

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Sample Code

private void Start()
{
	string path = "/storage/emulated/0/Download/";
	AndroidJavaObject keyConfig = new AndroidJavaObject("com.picovr.picokeyconfig.SystemKeyConfigClass");
	AndroidJavaObject ActivityContext = new AndroidJavaClass("com.unity3d.player.UnityPlayer").GetStatic<AndroidJavaObject>("currentActivity");
	keyConfig.Call("init", ActivityContext, path);
}

keyConfig.Call("setUserKeyConfig");
keyConfig.Call("setDefaultKeyConfig");

Configration file

Action_home_single_tap   :home click function

Action_home_double_tap   :home double tap function

Action_home_long_press   :home long press function

The value of the above functions can be set as, and the above values can be set as the corresponding functions defined below to take effect

1: start the application with the specified package name and class name.

2: return the launcher

3: launch Settings

4: return

5: no function, just send button notifications

Action_power_press power function

Not set: system default function 0: invalid 1: valid

Time_home_double_tap :double click to determine the interval

Time_home_long_press long press : the judgment interval

Just set it to milliseconds

Action_home_XXX _package = XXX

Action_home_XXX _class = XXX

Parameter set to function value 1

  1. In addition, note: manual modification of system key mode (equipment restart is required)

Open adb and copy the file to data/local/ TMP:

adb push SystemKeyConfig.prop /data/local/tmp/

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.