Key. Russian letters. Problem

Hello. The problem, in short: the key does not see Russian letters.

boolean keyboard = false; 

void setup() {   
textSize(50);
fullScreen();  
fill(0); }     


void draw() {   
background(255);  
 text(key, width/2, height/2); 
 println(key);
 }
 
 void mousePressed() {  
  if (!keyboard) {     
 openKeyboard();   
   keyboard = true;   
 } else {   
   closeKeyboard();   
   keyboard = false;  
  } }

I know that I make a mistake, but because of my inexperience, I can’t find her

I apologize if the question is stupid.
I really tried to find an answer on the forum, nothing happened

Hello,

The default font for Processing seems to support Russian in the canvas but not in the console:

void setup() 
  {   
  textSize(50);
  size(1280, 500);  
  fill(0);
  }     

void draw() 
  {   
  background(255);  
  text(key, width/2, height/2);
  text("Я могу распечатать это на экране", 100, 100); //canvas
  println("Я могу распечатать это на экране");  //console
  println(key, keyCode);
  }

I added Russian language to Windows 10 and was able to type these fonts with the keyboard and they did display in the canvas.

:slight_smile:

1 Like

It still doesn’t work for me.

Here, I used your code:


Here, NOT the Russian language works:

Here, the RUSSIAN language does not work:

О Gods of the forum help me find the answer to this question! :disappointed:

This seems like a bug with APDE. Have you tried contacting the developer?

No, I didn’t do it. What do you think is the best way for me to do this?

Hello,

I am not able to try this with an Android device at this time.
It seems that the fonts are correct so I am working with that.

This is a workaround and maps keys to Russian characters:

//https://processing.org/reference/switch.html

char rusKey;

void setup() 
  {   
  textSize(50);
  size(1280, 500);  
  fill(0);
  }     

void draw() 
  {   
  background(255);  
  text("Я могу распечатать это на экране", 100, 100);
//  println("Я могу распечатать это на экране");
  text(rusKey, 100, 300);
  text(key + "  " + rusKey + "  " + keyCode, 100, 400);
  }
  
void keyPressed()
  { 
  switch(key) 
    {
    case 'a': 
      rusKey = 'Я';  
      break;
    case 'b': 
      rusKey = 'э';  
      break;
    case 'c': 
      rusKey = 'ч';  
      break;
    case 'D': 
      rusKey = 'ь';  
      break;
    default:           
      rusKey = 'X';    // does not match the switch parameter
      break;
    }   
  }

It is incomplete and not mapping correctly; I leave this as an excercise.

:slight_smile:

As an exercise - very good. How to practice switch is fine)
But the problem has not disappeared.

I’ll look for a solution a little more. If I can’t find it, I’ll write my keyboard using the “press = letter” method, otherwise I don’t see an option to realize my idea.
But you can create a beautiful keyboard)))))
But this is a long time. I would not want to do this.

PS: I wrote to the developer by mail.

By the way, keyCode also does not recognize.
After pressing the English key, I press the Russian key, and keyCode does not change.
Moreover, numbers and symbols work fine in any case.

I do not know if this is useful to anyone, but I decided to supplement the topic.

I do not see any other options other than those suggested to me from the outside.
For example, to intercept clicks directly from the android.
Or use editText also android.

I’ll throw a link here to my other topic regarding this, if I get a suitable answer there.

My keyboard.
Problems otherwise could not be solved.

I don’t understand why you have to draw your own keyboard (is that what you did?).

Instead use the inbuilt keyboard and map keys to Russian characters.

But on Android device you need to set the system language / Keyboard layout… to Russian I guess.

Otherwise I can’t help you with that.

Chrisir

Thank you for responding here too)
I don’t need my keyboard, I made it and am doing it because I don’t see a way out of the situation.

Maybe the top not quite clearly written, I am poor in explanation.

The bottom line is that when I open the keyboard through openKeyboard (); , I write in English letters and use any characters - everything works. And if I click on the Cyrillic alphabet (I use Russian), the program does not see these clicks.
I checked, even keyCode does not change in any way.

Can you take a look at this topic with the information received?

PS: not only my problem, many people checked.

1 Like

I suggest map keys to Russian characters.

I think it’s a problem with the operating system and you wrote them already.

I can’t help your further.

Keys to Russian characters?

What is it? Can you explain in a nutshell?
You are welcome. It is important.

I was just referring to glvs statement and code

A. The result is: you write seeing the English keyboard, and enter the Russian letters.
And this does not fit.
:sob:

1 Like