螢幕功能:
whichScreen = 2; % 0:兩個螢幕一起顯示 1:編號1螢幕顯示 2:編號2螢幕顯示
window = Screen(whichScreen, 'OpenWindow');
priorityLevel=MaxPriority(['GetSecs'],['KbCheck'],['KbWait'],['GetClicks']);
white = WhiteIndex(window);
black = BlackIndex(window);
gray = (white+black)/2;
inc = white-gray;
Screen(window, 'FillRect',[R1,G1,B1]);
Screen(window,'Flip');
滑鼠作標
while 1
[X Y Button] = GetMouse;
[X Y]
end
滑鼠按鑑功能
import java.awt.Robot;
import java.awt.event.*;
mouse = Robot;
mouse.mousePress(InputEvent.BUTTON1_MASK); %按下事件
mouse.mouseRelease(InputEvent.BUTTON1_MASK); %釋放事件
沒有留言:
張貼留言