Forum rules - please read before posting.

Input - Recognize Arabic Keyboard and typeface

edited October 2014 in Technical Q&A
First of all. Thank you for the great support.

I tried to use an arabic keyboard to implement arabic in the input fields.
Still seems that it doesn't recognize the types.

Maybe it's because arabic keyboard is not recognized in the "Alphanumeric".

I found this on MenuInput.cs

inputType = AC_InputType.AlphaNumeric;

I'm investigating on this, if you have any idea or solution it would be greatly appreciated.

Thank you, as always.


  • Whenever a character is pressed on the keyboard, MenuInput's CheckForInput function is called to process it - I'd suggest starting there.
  • edited October 2014
    Just to keep you posted.

    I found a piece of code in PlayerMenus.cs that calls the CheckForInput:
    if (selectedInputBox)
    Event currentEvent = Event.current;
    if (currentEvent.isKey && currentEvent.type == EventType.KeyDown)
    selectedInputBox.CheckForInput (currentEvent.keyCode.ToString (), currentEvent.shift, selectedInputBoxMenuName);

    KeyCode takes the raw key code and this means only Alphanumeric  (A-z and 0-9) and usual keys, but it doesn't take arabic characters.
    This means it won't give back arabic to the method in MenuInput.
    I think that this is likely the issue. 

    I think the change needs to be made here, somehow, but without adding some conflit.
  • And Event.character recognises Arabic characters?
  • edited October 2014
    Yes. I just tested it today and it reads arabic chatacters. I use
    selectedInputBox.CheckForInput (currentEvent.character.ToString (), currentEvent.shift, selectedInputBoxMenuName);

    But in this way it doesn't read anymore backspace and space, enter, etc.

    I solved it with an if: 

    if keycode is Backspace||space||etc -> then pass keycode / else pass character
    Let me know if you have more suggestions.

  • Not sure about this, because of that caveat, which makes it much more difficult to read "shift" key variants and special characters.  If you're up for amending the script yourself, please be my guest - I'm hesitant to make such a change in the official release.
  • Yes. I'm trying it and it raises issues. (seems the words counts double in the input and it doesn't read Enter)

    Maybe I'll simply create a table to translate keycode from english to arabic IF language is arabic.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.