Skip to content

Instantly share code, notes, and snippets.

@frame
Last active October 24, 2016 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frame/71e1934016080d8e45a377de8d568e27 to your computer and use it in GitHub Desktop.
Save frame/71e1934016080d8e45a377de8d568e27 to your computer and use it in GitHub Desktop.
function DefaultKeyDownHandler( uiKey:number )
local keyPanChanged :boolean = false;
if uiKey == Keys.VK_ALT then
if m_isALTDown == false then
m_isALTDown = true;
EndDragMap();
ReadyForDragMap();
end
end
if( uiKey == Keys.VK_UP ) then
keyPanChanged = true;
m_isUPpressed = true;
end
if( uiKey == Keys.VK_RIGHT ) then
keyPanChanged = true;
m_isRIGHTpressed = true;
end
if( uiKey == Keys.VK_DOWN ) then
keyPanChanged = true;
m_isDOWNpressed = true;
end
if( uiKey == Keys.VK_LEFT ) then
keyPanChanged = true;
m_isLEFTpressed = true;
end
if( keyPanChanged == true ) then
ProcessPan(m_edgePanX,m_edgePanY);
end
-- START: next unit
if (uiKey == Keys.N) then
OnCycleUnitSelectionRequest();
end
-- END: next unit
return false;
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment