GE Lua Documentation

Press F to search!

IsKeyPressed

Definition


-- @/=[C]:-1
function IsKeyPressed(...)

Callers

@/lua/ge/extensions/editor/gen/region.lua
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Enter)) and out.inpave then
--        lo('??+++++++++++++++++++++++++++++++++++++++++++++++ region_to_GEN:'..#abase..':'..tostring(out.inpave))
@/lua/ge/extensions/editor/flowgraph/nodelibrary.lua
  -- Navigate the list with the keyboard
  --[[if im.IsKeyPressed(im.GetKeyIndex(im.Key_Enter)) then self.createNodeButtonListIndex = self.selectedButtonListIndex end
  if self.selectedButtonListIndex then
  if self.selectedButtonListIndex then
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_UpArrow)) then
      self.selectedButtonListIndex = math.max(self.selectedButtonListIndex - 1, 1)
    end
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_DownArrow)) then
      self.selectedButtonListIndex = math.min(self.selectedButtonListIndex + 1, self.numberOfButtons)
@/lua/ge/extensions/editor/gen/world.lua
		elseif scope == 'top' then
			if im.IsKeyPressed(im.GetKeyIndex(im.Key_Z)) then
--            if editor.keyModifiers.shift then
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Enter)) then
			lo('?? to_SAVE:')
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Delete)) then
		if out.inhole then
	--------------------
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Backspace)) then
--        if csave > #asave then return end

		if im.IsKeyPressed(im.GetKeyIndex(im.Key_C)) then
-- TO COPY BUFFER
				U.dump(incopy[cedit.mesh], '?? copied:')
--        elseif im.IsKeyPressed(im.GetKeyIndex(im.Key_V)) then
		elseif im.IsKeyPressed(im.GetKeyIndex(im.Key_V)) then
--        elseif im.IsKeyPressed(im.GetKeyIndex(im.Key_V)) then
		elseif im.IsKeyPressed(im.GetKeyIndex(im.Key_V)) then
-- PASTE
@/lua/ge/extensions/editor/gen/decal.lua
    if editor.keyModifiers.ctrl then
        if im.IsKeyPressed(im.GetKeyIndex(im.Key_Z)) then
--            lo('?? CTRL_Z:')
    --- KEYBOARD
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_RightArrow)) then
		incommand = {'right'}
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_LeftArrow)) then
        incommand = {'left'}
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_UpArrow)) then
		keyUD(1)
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_DownArrow)) then
		keyUD(-1)
	end
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_Delete)) then
        if cjunc then
    end
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_Enter)) then
        rdlist = editor.getAllRoads()
    if cpick and U._PRD == 0 and U._MODE ~= 'conf' then
        if im.IsKeyPressed(im.GetKeyIndex(im.Key_UpArrow)) then
            if tableSize(anodesel) == 1 and anodesel[1] then
            end
        elseif im.IsKeyPressed(im.GetKeyIndex(im.Key_DownArrow)) then
            local anode = editor.getNodes(croad)
            end
        elseif im.IsKeyPressed(im.GetKeyIndex(im.Key_RightArrow)) then
            -- mantle width up
            ter2road()
        elseif im.IsKeyPressed(im.GetKeyIndex(im.Key_LeftArrow)) then
            -- mantle width down
@/lua/common/extensions/ui/imguiUtils.lua
      imgui.EndTooltip()
      if imgui.IsKeyPressed(imgui.GetKeyIndex(imgui.Key_PageUp)) then
        self.sampleTime = self.sampleTime + 0.05
        self.sampleTime = self.sampleTime + 0.05
      elseif imgui.IsKeyPressed(imgui.GetKeyIndex(imgui.Key_PageDown)) then
        self.sampleTime = math.max(0, self.sampleTime - 0.05)
@/lua/ge/extensions/editor/gen/exp_meshexplorer.lua
------------------------------
--	if U._PRD == 0 and im.IsKeyPressed(im.GetKeyIndex(im.Key_X)) and editor.keyModifiers.ctrl then
--		W.up(2,'X-Ray'..' (WIP)')
--	end
    if im.IsKeyPressed(im.Key_V) and editor.keyModifiers.ctrl then
        if beamdata.abeampick and #beamdata.abeampick > 0 then
    end
    if im.IsKeyPressed(im.Key_ModCtrl) then
        if inbeams == 2 then
    end
    if im.IsKeyPressed(im.Key_ModShift) then
--            lo('?? shiftL:'..#ageopin..':'..tostring(inbeams))
@/lua/ge/extensions/editor/mainToolbar.lua
          -- Handle focus loss or Escape to cancel editing
          if not im.IsItemActive() and (im.IsMouseClicked(0) or im.IsKeyPressed(im.Key_Escape)) then
            finishEditingSetName()
@/lua/ge/extensions/editor/api/valueInspector.lua
      if io.KeyCtrl then
        if imgui.IsKeyPressed(imgui.GetKeyIndex(imgui.Key_C)) then
          setClipboard(jsonEncode({copiedValue = fieldValue, copiedFieldType = fieldType}))
        end
        if imgui.IsKeyPressed(imgui.GetKeyIndex(imgui.Key_V)) then
          local tbl = jsonDecodeSilent(getClipboard(), "ValueInspectorCopyPasteMenu")
@/lua/common/extensions/ui/imgui_gen_luaintf.lua
function M.IsKeyDown(ImGuiKey_key) return imgui.IsKeyDown(ImGuiKey_key) end
function M.IsKeyPressed(ImGuiKey_key, _repeat)
  if _repeat == nil then _repeat = true end
  if _repeat == nil then _repeat = true end
  return imgui.IsKeyPressed(ImGuiKey_key, _repeat)
end
@/lua/ge/extensions/editor/gen/exp_frame.lua
--------------------
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_DownArrow)) then
--        lo('?? AD:')
    end
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_Space)) then
        if cmove then
    end
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_Escape)) then
--    if im.IsKeyPressed(im.GetKeyIndex(im.Key_Space)) then
    if im.IsKeyPressed(im.GetKeyIndex(im.Key_Escape)) then
--    if im.IsKeyPressed(im.GetKeyIndex(im.Key_Space)) then
        U.dump(dw, '>>>> DW:'..nmove..' L:'..L)
@/lua/ge/extensions/editor/buildingEditor.lua
	--- KEYS
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_X)) and editor.keyModifiers.ctrl then
		reload()

	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Enter)) then
		W.onKey(im.Key_Enter)
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Backspace)) then
		W.onKey(im.Key_Backspace)
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Space)) then
		W.onKey(im.Key_Space)
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_Escape)) then
		W.onKey(im.Key_Escape)
		end
		if im.IsKeyPressed(im.GetKeyIndex(im.Key_X)) then
				lo('?? bE_RELOAD:')

	if im.IsKeyPressed(im.GetKeyIndex(im.Key_UpArrow)) then
		W.keyUD(1)
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_DownArrow)) then
		W.keyUD(-1)

	if im.IsKeyPressed(im.GetKeyIndex(im.Key_RightArrow)) then
		W.keyRL(1)
	end
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_LeftArrow)) then
		W.keyRL(-1)
local function onEditorGui()
	if im.IsKeyPressed(im.GetKeyIndex(im.Key_X)) and editor.keyModifiers.ctrl then
--		print('?? to_RELOAD:')