Search Unity

Getting Touch Keyboard last pressed key value on mobile devices

Discussion in '2D' started by SartGames, Oct 17, 2021.

  1. SartGames

    SartGames

    Joined:
    Jul 13, 2020
    Posts:
    3
    Ive been looking alot and just couldn't find a solution...

    I need to get the last pressed key value without having to press done every time.

    For example to detect when the player touched the "z" key and excute a function based of the detection. I know I can do that easily in pc but it seems not to work with mobile keyboards.
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    I think most mobile keyboard setups won't work this way. They're designed to enter an entire line of text before disappearing.

    I don't know what the Apple/Google limitations are right now but perhaps you can throw up your own keyboard grid, then do what you like with it.

    BUT READ THE APPLE/GOOGLE TERMS OF SERVICE FIRST... they used to require that you use ONLY their keyboards.
     
  3. SartGames

    SartGames

    Joined:
    Jul 13, 2020
    Posts:
    3
    Oh well, Thanks anyway...
    Guess I'll make my own keyboard...
    It's just for a typing game not to enter sensitive info so I don't think Google/Apple would care much
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Long ago I learned never to assume this. They care about the weirdest things, sometimes in the most random manner. I've seen them make a stink about a feature that is three or four years old, as in had been in happy usage all that time, then suddenly "NO!"