Making a touchscreen keyboard using GUIDE pushbuttons

조회 수: 6 (최근 30일)
Kunal
Kunal 2013년 4월 22일
Any help on this topic would be appreciated. I need this in the next 18 hours!
I am trying to create a GUI which has an edittext box and when you click on it, a keyboard made of pushbuttons pops up.
I want to know how to get this keyboard to work. One problem I am having is that it does not pop up immediately when I click the edittext, I have to press enter to make it come.
I'd like the keyboard to update the edittext box on the original GUI as I press the buttons!

채택된 답변

Sean de Wolski
Sean de Wolski 2013년 4월 22일
I just answered something similar last week:
As for getting the editbox to poof the new window, you might have to use a regular textbox's 'ButtonDownFcn'. This is because an editbox will allow you to edit with the keyboard on click where a textbox gives you the ability program what happens when you click on it.
  댓글 수: 7
Sean de Wolski
Sean de Wolski 2013년 4월 22일
That would be one way. Another would be to define str first. And then set it to the string of the edit box after. This will create str in the workspace:
str = strcat(etc,letter)
set(hEdit,'str',str)
You will still likely need a uiwait on the figure to wait until either a button is pressed to indicate that the user is done typing or the figure is closed.
Kunal
Kunal 2013년 4월 23일
편집: Kunal 2013년 4월 23일
One last problem. AddLetter has the complete string. How do I pass it from AddLetter to OnScreenKeyboard? I used a global in OSK and changed it in AL to keep track of the main string, but I can't find a way to set OSC's output variable equal to this global.
% code
function [str] = OnScreenKeyboard
global str2;
str2 = '';
and then inside AddLetter
% code
str2 = strcat(str2,letter);
and then right outside AddLetter
% code
str = str2;
but the problem is the control of the program never reaches that last statement, so str is always ''

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Desktop에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by