On-Screen Keyboard

Hi guys.
  • I would like to make on-screen keyboard.I have no problem in pressing the keys on the keyboard.
  • After pressing a key at the moment{pause(2)},I can write one by clicking on the ground.
  • I want,the window without changing,I want to print the window.
  • I can say is as follows.input text document, trying to guide.
ty

4 件のコメント

Sean de Wolski
Sean de Wolski 2011 年 5 月 25 日
What is your question?
nsbd
nsbd 2011 年 5 月 25 日
using java, we want to do how the process window.
exam:windows media player,winamp,text document.
I hope you understand
Sean de Wolski
Sean de Wolski 2011 年 5 月 25 日
I still don't see a question. And no your goal is not clear.
nsbd
nsbd 2011 年 5 月 25 日
Look at the lower side

サインインしてコメントする。

回答 (3 件)

Walter Roberson
Walter Roberson 2011 年 5 月 25 日

0 投票

I am not at all sure that I understand the question, but I suspect that what you are looking for is the Java Robot class.

1 件のコメント

nsbd
nsbd 2011 年 5 月 25 日
please Look at the lower side. new write

サインインしてコメントする。

nsbd
nsbd 2011 年 5 月 25 日

0 投票

"
function psh_la_Callback(hObject, eventdata, handles)
pause(3)
import java.awt.Robot;
import java.awt.event.*;
key = Robot ;
while (get(handles.psh_la,'Value') == 1) ;
key.keyPress(java.awt.event.KeyEvent.VK_Z);
key.keyRelease(java.awt.event.KeyEvent.VK_Z);
end
"
After running this.2 seconds pass a text document.after Z ticking. but I do not want to switch.
:( I do not have English

7 件のコメント

Walter Roberson
Walter Roberson 2011 年 5 月 25 日
Is the difficulty that the focus is changing to the target window and you do not wish the focus to change? If so, then you can use figure(gcf) to bring the current figure back in to focus.
nsbd
nsbd 2011 年 5 月 25 日
Yes.How should I do?
Walter Roberson
Walter Roberson 2011 年 5 月 25 日
function psh_la_Callback(hObject, eventdata, handles)
thisfig = ancestor(hObject,'figure');
pause(3)
import java.awt.Robot;
import java.awt.event.*;
key = Robot ;
while (get(handles.psh_la,'Value') == 1) ;
key.keyPress(java.awt.event.KeyEvent.VK_Z);
key.keyRelease(java.awt.event.KeyEvent.VK_Z);
figure(thisfig);
end
nsbd
nsbd 2011 年 5 月 25 日
windows...Run...open(osk). (on-screen keyboard)
I want something like that.I do not want in matlab thisfig. :( sorry
using guide,Using the arrow key on windows media player.
I hope you understand
Walter Roberson
Walter Roberson 2011 年 5 月 25 日
thisfig is just a variable name, and is used to try to return focus to the tool.
It should not matter that you are using GUIDE. GUIDE is limited and you will need to program some parts yourself.
nsbd
nsbd 2011 年 5 月 25 日
http://www.dreamincode.net/forums/topic/107179-virtual-keyboard/
http://www.dreamincode.net/forums/index.php?app=core&module=attach&section=attach&attach_id=12117&s=6721f3f6e47aa9ccd2f403c3899b3a46
Something Did he similar can be done.
nsbd
nsbd 2011 年 5 月 25 日
above that is written in C #

サインインしてコメントする。

Matt Fig
Matt Fig 2011 年 5 月 25 日

0 投票

I am not sue of your question either. Here is the basic layout of a custom GUI keyboard that I made for a client. Notice that I left all of the callbacks out, so the GUI does nothing right now. The original GUI used complex callbacks including JAVA and ActiveX calls, but I won't include it here. Perhaps you can adapt it to your needs.
function [] = keyboard_gui()
set(0,'units','pix')
SCR = get(0,'screensize');
S.fh = figure('menubar','none',...
'numbertitle','off',...
'name','Friendly Keyboard',...
'units','pix',...
'resize','off',...
'position',[20 20 SCR(3)-25 SCR(4)-80],...
'color',[.5 .5 1]);
S.POS = cell(28,1); % Pre-allocate so we get a column vector.
for ii = 1:26 % Create the letter buttons.
ax = subplot(5,6,ii); % Use SUBPLOT to get alignment.
set(ax,'units','normalized','visible','off')
S.POS{ii} = round(get(ax,'pos')*1000)/1000 - [0 .075 0 0];
delete(ax)
S.pb(ii) = uicontrol('style','push',...
'units','norm',...
'position',S.POS{ii},...
'string',char(64+ii),...
'fontsize',45,...
'fontweight','bold',...
'enable','off');
end
pwidth = S.POS{2}(3)+S.POS{2}(1)-S.POS{1}(1);
S.POS{27} = [S.POS{3}(1) S.POS{26}(2) pwidth S.POS{1}(4)]; % BACKSPACE button.
S.pb(27) = uicontrol('style','push',...
'units','norm',...
'position',S.POS{27}+[0 0 .2705 0],...
'string','Delete',...
'fontsize',35,...
'fontweight','bold',...
'enable','off');
S.pb(28) = uicontrol('style','push',... % The CLEAR button.
'units','norm',...
'position',[0.84625 0.875 .10375 0.11],...
'string','Clear',...
'fontsize',35,...
'fontweight','bold',...
'enable','off');
S.ed = uicontrol('style','edit',...
'units','norm',...
'position',[0.05 0.875 0.7825 0.11],...
'fontsize',50,...
'fontweight','bold',...
'horizontalalignment','left',...
'enable','off');
set(S.pb,'backgroundcolor',[.9 .6 .6])
drawnow % Flush event queue

13 件のコメント

Sean de Wolski
Sean de Wolski 2011 年 5 月 25 日
Not QWERTY!!!!!
Matt Fig
Matt Fig 2011 年 5 月 25 日
That's how he wanted it!
nsbd
nsbd 2011 年 5 月 25 日
Click on the keys,write to the floor in the background.
This is not writing :(
Matt Fig
Matt Fig 2011 年 5 月 25 日
Did you read my comments before the function? I state that all of the callbacks have not been included...
Also, what do you mean, "write to the floor"? Do you mean, "write to the command window"?
nsbd
nsbd 2011 年 5 月 25 日
no write command windows.I want write exam :text document
or Using the arrow key on windows media player.
but in doing so,guide window,Don't get sub - icon status
Walter Roberson
Walter Roberson 2011 年 5 月 25 日
I think I understand your question now. I do not use Windows much, so I do not know the solution if the code in my answer does not work.
Matt Fig
Matt Fig 2011 年 5 月 25 日
I see, then at in the GUI you would need to open a file and in the callback use FPRINT to write to it. This wouldn't be too hard to add to what I gave you.
nsbd
nsbd 2011 年 5 月 25 日
windows...Run...open(osk). (on-screen keyboard)
I want something like that.I do not want in matlab thisfig. :( sorry
using guide,Using the arrow key on windows media player.
I hope you understand
Walter Roberson
Walter Roberson 2011 年 5 月 25 日
Matt, I do not see how fprintf() fits in with the problem as I understand it.
My understanding is that the problem is that when a key event is sent to another window using Java Robot, that the MATLAB window is getting iconized.
Matt Fig
Matt Fig 2011 年 5 月 25 日
I understood differently. If you look at comment #5 above, nsbd said write to text file. Of course this doesn't take care of the ActiveX stuff...
nsbd
nsbd 2011 年 5 月 25 日
So, how can write a virtual keyboard in Matlab.
Do you have a sample of your hands?
thks.
nsbd
nsbd 2011 年 5 月 25 日
currently at 00:27 I have to go sleep.good night
:) thks bro.
Walter Roberson
Walter Roberson 2011 年 5 月 25 日
@Matt, I understood "exam :text document" to mean "for example, write in to a text editor's window".
@nsbd: We are still trying to understand what you are trying to do. I do not understand yet why the psh_la_Callback code I suggested is not usable?

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeEnvironment and Settings についてさらに検索

タグ

質問済み:

2011 年 5 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by