Skip to content
Permalink
Browse files

fix #25 - remap alt key and meta key

  • Loading branch information...
john-hu committed Jun 10, 2015
1 parent 292f7f6 commit a2baf65e0407f294534560278b72474cb9f9dc13
@@ -3,6 +3,9 @@
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectPlainTextFileTypeManager">
<file url="file://$PROJECT_DIR$/app/src/main/res/raw/shun_feng_er_layout.kcm" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
@@ -22,5 +25,4 @@
</state>
</states>
</component>
</project>

</project>
@@ -22,6 +22,16 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver
android:name=".DummyInputDeviceReceiver"
android:label="@string/keyboard_layouts_label">
<intent-filter>
<action android:name="android.hardware.input.action.QUERY_KEYBOARD_LAYOUTS" />
</intent-filter>
<meta-data
android:name="android.hardware.input.metadata.KEYBOARD_LAYOUTS"
android:resource="@xml/shun_feng_er_map" />
</receiver>
</application>

</manifest>
@@ -0,0 +1,15 @@
package com.miidio.audio.client;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

/**
* This is a dummy Input Device Receiver for removing the warning of manifest file.
*/
public class DummyInputDeviceReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// Do nothing
}
}
@@ -71,8 +71,9 @@
map.put(138, 119);//F8
map.put(139, 120);//F9
map.put(140, 121);//F10
map.put(141, 122);//F11
map.put(142, 123);//F12
// We use F11 and F12 to replace meta and alt for overriding android shortcuts.
// map.put(141, 122);//F11
// map.put(142, 123);//F12
map.put(120, 154);//SRNPRT
map.put(116, 145);//SCROLLLOCK
map.put(121, 19);//PAUSE
@@ -111,14 +112,16 @@
// map.put(25, ??);//VOLUME_DOWN
map.put(158, 44);//NUMPAD_COMMA
map.put(76, 111);//DIVIDE
map.put(57, 18);//LEFTALT
map.put(58, 18);//RIGHTALT
// map.put(57, 18);//LEFTALT
// map.put(58, 18);//RIGHTALT
map.put(141, 18);// remap F11 to alt, that's on purpose
map.put(59, 16);//LEFTSHIFT
map.put(60, 16);//RIGHTSHIFT
map.put(113, 17);//LEFTCTRL
map.put(114, 17);//RIGHTCTRL
map.put(117, 157);//LEFTMETA
map.put(118, 157);//RIGHTMETA
// map.put(117, 157);//LEFTMETA
// map.put(118, 157);//RIGHTMETA
map.put(142, 157);// remap F12 to meta, that's on purpose
}

public static int get(int key) {
@@ -0,0 +1,11 @@
# Remap some shortcuts to nothing
# UTF-8 encoded
type OVERLAY

# remap meta key
map key 125 F12
map key 126 F12

# remap alt key
map key 56 F11
map key 100 F11
@@ -11,4 +11,5 @@
<string name="status_connected">Connected to %1$s</string>
<string name="status_error_no_address">Please specify IP or DNS before connect.</string>
<string name="label_password">Password:</string>
<string name="keyboard_layouts_label">Remap meta and alt keys</string>
</resources>
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<keyboard-layouts xmlns:android="http://schemas.android.com/apk/res/android">
<keyboard-layout
android:name="shun_feng_er_map"
android:keyboardLayout="@raw/shun_feng_er_layout"
android:label="@string/app_name" />
</keyboard-layouts>

0 comments on commit a2baf65

Please sign in to comment.
You can’t perform that action at this time.