2024-10-22 09:52 AM - edited 2024-10-22 09:53 AM
Hello to all,I am working on a stm32h745i-disk project that uses keyboard and I would like to hide the characters in the password field.
how can I do it? i.e. I don't understand when you press a key on the keyboard where do you type so that it is shown above the keyboard before you hit ok and it is passed to the GUI with “Unicode::strncpy(ContrasenaBuffer, keyboard.getBuffer(), CONTRASENA_SIZE);”
The video guide I used was:
https://www.youtube.com/watch?v=Tkz9099a7a4
testing and trying to understand the keyboard related files I could only hide them once you hit ok and they show up in the GUI using two buffers where one is filled with “*”.
I would like to do something similar to the video (minute 5:38) https://www.youtube.com/watch?v=0--7qFmWZMQ
but in my touchGFX code and later add a button to show the password if I want to but I guess I can do that later if I can solve this.
I share my View.cpp and the keyboard thing.please ignore Login_inicioView::Validacion_usuario() as it is something for the future.
Thanks.
Solved! Go to Solution.
2024-11-04 01:54 PM
thanks@Marc_LM
If I think I can solve that, thinking about it, your idea gave me an idea hehe ,
that the button calls a function that updates the text with a buffer or the other.
I'm currently working with two buffers only I have to fix a small detail
and that is that the function that @GaetanGodart passed me is also affected by other keys pressed that are no
I can't avoid the execution of that part of the code because I don't know what the value of that
of code because I don't know what value has the variable “keyChar” when that key is pressed
(I guess that makes the problem I'm having).
what problem is it? well when I press delete or shift whatever I type then on the keyboard is not saved anywhere and if I delete it is deleted.
and if I delete it deletes one position less than the pressed ones.
I am not sure what is going on but the text that is typed with keyboard that does not use the gaetan function does not have that problem so my only assumption that the problem is that, that function is called by pressing any key but if you press shift or delete several times it is only executed once keyPressedhandler while the function corresponding to delete or change to lowercase / uppercase if it continues running as many times as you press the corresponding key regardless of whether it is pressed continuously or after another key.
but the buffer will be corrupted or something and does not save any extra key presses after that action.
2024-11-05 01:36 AM
Hello @Maximiliano and @Marc_LM ,
Indeed, it is not possible to change font for a single textArea at runtime.
Maximiliano, you can use the touchgfx_printf() method to print the value of the key in a console when running the simulator.
Regards,
2024-11-11 04:45 AM
thank you very much @GaetanGodart ,
With this I was able to move forward little by little to achieve my goal. again thanks for the follow up.
@Marc_LM thanks also.
2024-11-11 05:11 AM
Hello @Maximiliano ,
I am glad you were able to achieve your desired result!
Don't hesitate if you have other TouchGFX related question. :smiling_face_with_smiling_eyes:
Regards,