pushbutton in gui for space bar
Show older comments
I am creating a mouse controlled virtual keyboard using pushbuttons in gui.but cant create callback code for space bar.please help. my code for space bar:
function space_Callback(hObject, eventdata, handles)
% hObject handle to space (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
OLDstring=get(handles.text1,'string');
set(handles.text1,'string',sprintf('%s %s',OLDstring,' '));
this creates space in static text but after i press another keybutton for input...the space is gone and the inputs are displayed without the space.. ..code for other input...example:for entering h:
function h_Callback(hObject, eventdata, handles)
% hObject handle to h (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
OLDstring=get(handles.text1,'string');
NEWstring=('h');
textstring=strcat(OLDstring,NEWstring);
set(handles.text1,'string',textstring);
Accepted Answer
More Answers (0)
Categories
Find more on Operators and Elementary Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!