Aller au contenu
View in the app

A better way to browse. Learn more.

Forum de Frandroid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Récupérer texte clavier

Featured Replies

Posté(e)

Mon application n'a pas de champ de texte, elle est essentiellement "graphique (des View un peu partout)

J'ai associé à un menu de mon Activity l'affichage du clavier virtuel

pour ceux que ça intéresse :

   private void toggleKeyboard()
   {
       InputMethodManager imm = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE);
       imm.toggleSoftInput(0, 0);
   }

Question toute bête : comment fait on pour récupérer le texte saisi au clavier ? (caractère par caractère)

J'ai pensé à : un champ de texte (unique) invisible

       android:layout_width="0px"
       android:layout_height="0px"
       android:id="@+id/test" />

dans mon layout

Ensuite, je le récupère dans l'Activity :

       EditText test = (EditText) this.findViewById(R.id.test);
       test.addTextChangedListener(this);

et j'implémente les méthodes de TextWatcher

Là, j'arrive bien à récupérer le texte saisi sur le clavier, mais j'ai un problème avec les touches "secondaires" du clavier virtuel.

Quand on maintient une touche pour accéder aux autres.

Et bien, ça m'affiche le caractère de la 1ere touche, ça l'efface, puis ça affiche le caractère de la 2eme touche.

Une solution ?

Merci

Posté(e)
  • Auteur

En gros, dans les applications VNC que j'ai pu tester sur Android (Remote VNC Pro)

comment font ils pour récupérer le texte du clavier caractère par caractère?

Sachant que sur le clavier du HTC Hero, la sélection d'une touche "secondaire" par appuis long

écrit le texte de la première touche, puis l'efface, et écrit le texte de la deuxieme touche.

  • 2 weeks later...

Rejoignez la conversation

Vous pouvez poster maintenant et vous enregistrez plus tard. Si vous avez un compte, connectez-vous maintenant pour poster.

Invité
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Répondre à ce sujet…

Account

Navigation

Rechercher

Rechercher

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.