Announcement

Collapse
No announcement yet.

Receiving keystrokes in unity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Receiving keystrokes in unity

    Hi all

    excuse the beginner's question.
    I need to receive all keystrokes in a Unity application.
    repeatedly printing the input string reveals that not all keystrokes are sent to/captured by the application.
    In fact only the first time a key is pressed the application is notified.
    another issue is the fact that if a key stays pressed the application expects to receive it multiple times.

    all suggestions welcome

    Thanks,
    Elan

  • #2
    Hi Elan,

    A couple of questions:
    • Are you sending Keycode or Key Combo events?
    • What message are you sending to control the keystrokes? By default, a value of 1.0 will simulate a pressed keystroke (Keycode or Key Combo), and 0.0 will release the keystroke.
    My initial guess is that the messages you send are not triggering the events properly, but I may be wrong. If you could provide me with a small Unity example, I could try to reproduce the behavior you are describing.

    About keystroke repetition : There is a hidden preference that allows you to enable keystroke repetition. This behavior has been disabled by default after users compained that keystroke should not repeat.

    The default behavior for OSCulator is to trigger the keystrokes without repeating them. However, a normal keyboard do repeats the characters as long as the key is pressed. To enable this behavior, type this command in the Terminal:


    Code:
    defaults write net.osculator.OSCulator DisableKeyRepeat NO
    and if you want to revert back to the default setting:


    Code:
    defaults delete net.osculator.OSCulator DisableKeyRepeat
    The key repetition rate is taken from the system setting, defined in the System Preferences application.


    Best,
    Cam

    Comment


    • #3
      hi camille

      done some more investigation.
      apparently the issue is not OSCulator related.
      what i'm trying to do is receive keyboard input without defining a GUI.TextField but the input stream only provides unique keys pressed.
      i probably need to refer that to a unity forum

      thanks again
      Elan.

      Comment

      Working...
      X