Rocket.Chat.ReactNative icon indicating copy to clipboard operation
Rocket.Chat.ReactNative copied to clipboard

Option to send or to make a new line when pressing the enter key in the virtual/hardware keyboard

Open TehPeGaSuS opened this issue 6 years ago • 23 comments

The app could have an option to send on enter or create new line when using the enter key. By default, IMHO, it should respect the settings we have in our profile (I've set in to send via web interface).

TehPeGaSuS avatar Mar 19 '19 20:03 TehPeGaSuS

@TheMythPT Nice!

diegolmello avatar Mar 19 '19 20:03 diegolmello

@TheMythPT if he chooses send on enter how will he make a new line if he wants (on Android especially), I tried but couldn't do it

The idea is the following:

  1. The app should use the default set on browser and, iirc, the default is to send on Enter.
  2. The option on the app would override the web settings, so basically the behaviour inside the app would differ from the browser behaviour.

TehPeGaSuS avatar May 17 '19 21:05 TehPeGaSuS

@TheMythPT How would the user add a new line? Do you have an example app that does it? Twitter, Facebook, etc?

diegolmello avatar May 20 '19 12:05 diegolmello

Like I've said above

  1. If the Send on Enter is enabled, there's no option to add a newline.
  2. If Send on Enter is disabled, current behaviour is used.

All the other apps I've tried behave like this, basically.

TehPeGaSuS avatar May 20 '19 17:05 TehPeGaSuS

@TheMythPT I've tried Slack, WhatsApp, Twitter and Discord. None of them have this behaviour.

diegolmello avatar May 20 '19 17:05 diegolmello

Makes sense, although those apps are really a bit crappy without almost any possible customisation.

Check here

TehPeGaSuS avatar May 20 '19 17:05 TehPeGaSuS

@TheMythPT An example! Now we're talking :)

diegolmello avatar May 20 '19 17:05 diegolmello

@TheMythPT An example! Now we're talking :)

Usually I don't outsource my sources. I like people to think that was my idea 😋

TehPeGaSuS avatar May 20 '19 17:05 TehPeGaSuS

@diegolmello also, your WhatsApp must be very outdated! :stuck_out_tongue_closed_eyes:

TehPeGaSuS avatar May 20 '19 18:05 TehPeGaSuS

@TheMythPT My WhatsApp is updated on iOS and I don't have this feature, but it's nice to know it exists!

diegolmello avatar May 20 '19 18:05 diegolmello

@diegolmello, you should already know that good stuff is just available to Android users! 😝

TehPeGaSuS avatar May 20 '19 19:05 TehPeGaSuS

Just a quick +1 for this feature, I use an iPad with magic keyboard a lot and it's frustrating that there is no keyboard only way of sending a message. Return, Shift+return and alt+return all do the same thing so it'd be nice of one those could be repurposed

andrewgribben avatar Jun 15 '22 10:06 andrewgribben

Agreed, and I'd like to add that I can't even tap the send button without moving the iPadOS keyboard controls out of the way first, for every single message. There really should be a way to send via keyboard, like Option-Return or Cmd-Return.

IMG_5135

maiksd avatar Jul 06 '22 11:07 maiksd

@maiksd How can I reproduce that? I was not able to open those keyboard controls on top of send button.

diegolmello avatar Jul 06 '22 13:07 diegolmello

@diegolmello On an iPad running iPadOS 15 with a keyboard attached, in iPadOS Settings -> General -> Keyboard, activate "Shortcuts", but keep "Predictive" off. That will prevent the bottom entry field to be raised up, and the shortcuts controls end up covering the send button.

maiksd avatar Jul 06 '22 13:07 maiksd

That's an OS thing and you can move it around.

https://user-images.githubusercontent.com/804994/177596867-462310a9-34cc-4767-8dd0-c893893c7493.mp4

diegolmello avatar Jul 06 '22 16:07 diegolmello

Sure you can, and you must to send a message. But it will reappear in the lower right corner again and again anyway, so that's not a solution.

maiksd avatar Jul 06 '22 19:07 maiksd

But it will reappear in the lower right corner again and again anyway, so that's not a solution.

No, it's going to appear wherever you placed for the last time.

Anyway, you can just turn that off by disabling shortcuts and predictive. You don't want to show it.

diegolmello avatar Jul 06 '22 19:07 diegolmello

Sure, I can deal with it by moving it around or using iOS settings that I don't want to use. Disabling shortcuts loses me the ability to invoke dictation, for example.

Why not improve the application and do it like e.g. Slack does it (return defaults to send, option-return for new line)?

maiksd avatar Jul 06 '22 19:07 maiksd

I was just trying to help you use the app. This issue is open yet because we're looking for contributors and this is a wanted feature. Are you willing to contribute?

diegolmello avatar Jul 06 '22 19:07 diegolmello

I am, but I lack the required skillset I'm afraid. If you need some Java backend programming, contact me...

maiksd avatar Jul 06 '22 19:07 maiksd

We would need something like this lib to support enter and shift+enter functionality coming from a hardware keyboard https://github.com/emilioicai/react-native-hw-keyboard-event

diegolmello avatar Jul 06 '22 20:07 diegolmello