팩토리 » Api

getmouseeventpos

Description

마우스 이벤트의 상세 좌표 및 키보드(alt/ctrl/shift키) 눌림상태 정보 오브젝트를 리턴한다. 버튼/스케쥴 컴포넌트의 마우스 관련 이벤트 함수에서 호출해야 정상적인 값을 얻을 수 있다.

Return Value

Type Description
class 마우스 이벤트에 대한 상세 좌표 및 키보드 눌림상태 정보 오브젝트 또는 null

Remark

리턴되는 정보 오브젝트의 구조는 아래와 같다.

objMousePosInfo = {
	offsetX: 0,  // 컴포넌트 기준 Left 좌표
	offsetY: 0,  // 컴포넌트 기준 Top 좌표
	clientX: 0,  // 브라우저 클라이언트 영역 기준 Left 좌표
	clientY: 0,  // 브라우저 클라이언트 영역 기준 Top 좌표
	pageX : 0,   // 브라우저 페이지 기준 Left 좌표
	pageY : 0,   // 브라우저 페이지 기준 Top 좌표
	screenX: 0,  // 컴퓨터 스크린 좌측 상단 기준 Left 좌표
	screenY: 0,  // 컴퓨터 스크린 좌측 상단 기준 Top 좌표
	altKey: false,   // alt키 눌림상태
	ctrlKey: false,  // ctrl키 눌림상태
	shiftKey: false  // shift키 눌림상태
}

Example

function btn_mousepos_on_mouseup(objInst) { var pos = factory.getmouseeventpos(); factory.consoleprint("Offset: " + pos.offsetX + ", " + pos.offsetY); factory.consoleprint("Client: " + pos.clientX + ", " + pos.clientY); factory.consoleprint("Page: " + pos.pageX + ", " + pos.pageY); factory.consoleprint("Screen: " + pos.screenX + ", " + pos.screenY); factory.consoleprint("AltKey: " + pos.altKey); factory.consoleprint("CtrlKey: " + pos.ctrlKey); factory.consoleprint("ShiftKey: " + pos.shiftKey); }

Viewer Ver.

9.1.1.1

Update Date

20210420