Mm 10601 - Use Enter Key to send message on Hardware Keyboards (#3760)

* Reacting to shift-enter events on iOS

* moving keyEvent logic to handleHardwareEnterPress

* configured android to work with keyEvents

* using dispatchKeyEvent instead of onKeyUp

* using react-native-hw-keyboard-event

* cleanup

* updated package name

* update package name

* using react-native-hw-keyboard-event v0.0.2

* reverted cocoapods version change

* Documentation

* fix detection of Shift-Enter on android

* simplify dispatchKeyEvent()

* fix for stacked hardware keyboard events

* Update android/app/src/main/java/com/mattermost/rnbeta/MainActivity.java

Co-Authored-By: Miguel Alatzar <migbot@users.noreply.github.com>

* simplify dispatchKeyEvent

* removed yarn.lock

* using react-native-hw-keyboard-event v0.0.4

* Using ACTION_UP instead of ACTION_DOWN

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
Emilio Rodriguez
2020-02-04 17:34:14 +01:00
committed by GitHub
parent e62c9b7a6d
commit 0b98d82bfa
9 changed files with 87 additions and 31 deletions

View File

@@ -6,6 +6,7 @@ import android.content.Context;
import android.content.RestrictionsManager;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import java.io.File;
import java.util.HashMap;
import java.util.Arrays;
@@ -69,6 +70,8 @@ import com.facebook.soloader.SoLoader;
import com.mattermost.share.RealPathUtil;
import com.github.emilioicai.hwkeyboardevent.HWKeyboardEventPackage;
public class MainApplication extends NavigationApplication implements INotificationsApplication, INotificationsDrawerApplication {
public static MainApplication instance;
@@ -202,7 +205,8 @@ public class MainApplication extends NavigationApplication implements INotificat
new LinearGradientPackage(),
new ReactVideoPackage(),
new RNGestureHandlerPackage(),
new RNPasteableTextInputPackage()
new RNPasteableTextInputPackage(),
new HWKeyboardEventPackage()
);
}