IsKeyDown
Definition
-- @/=[C]:-1
function IsKeyDown(...)
Callers
@/lua/common/extensions/ui/imgui_gen_luaintf.lua
function M.ColorConvertHSVtoRGB(float_h, float_s, float_v, float_out_r, float_out_g, float_out_b) imgui.ColorConvertHSVtoRGB(float_h, float_s, float_v, float_out_r, float_out_g, float_out_b) end
function M.IsKeyDown(ImGuiKey_key) return imgui.IsKeyDown(ImGuiKey_key) end
function M.IsKeyPressed(ImGuiKey_key, _repeat)
function M.ColorConvertHSVtoRGB(float_h, float_s, float_v, float_out_r, float_out_g, float_out_b) imgui.ColorConvertHSVtoRGB(float_h, float_s, float_v, float_out_r, float_out_g, float_out_b) end
function M.IsKeyDown(ImGuiKey_key) return imgui.IsKeyDown(ImGuiKey_key) end
function M.IsKeyPressed(ImGuiKey_key, _repeat)
@/lua/ge/extensions/editor/api/gui.lua
end
v[v_index] = v[v_index] - (imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_ReservedForModCtrl)) and step_fast or step)
end
end
v[v_index] = v[v_index] + (imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_ReservedForModCtrl)) and step_fast or step)
end
@/lua/ge/extensions/editor/toolUtilities/polygon.lua
-- Manage the toggling of the gizmo on/off using the ALT key.
local isAltDown = im.IsKeyDown(altKeyIdx)
if isAltDown and isAltDown ~= lastAltDown then
-- Handle node deletion using the delete key.
if im.IsKeyDown(delKeyIdx) then
if not hasDeletePressedRecently and selectedNodeIdx > 0 and selectedNodeIdx <= #polygon then
@/lua/ge/extensions/editor/toolUtilities/splineInput.lua
mouseVel2D:set(mousePos.x - mouseLast.x, mousePos.y - mouseLast.y, 0.0)
local isShiftDown, isAltDown, isCtrlDown = im.IsKeyDown(shiftKeyIdx), im.IsKeyDown(altKeyIdx), im.IsKeyDown(ctrlKeyIdx)
local isCDown, isVDown, isDelDown = im.IsKeyDown(cKeyIdx), im.IsKeyDown(vKeyIdx), im.IsKeyDown(delKeyIdx)
mouseVel2D:set(mousePos.x - mouseLast.x, mousePos.y - mouseLast.y, 0.0)
local isShiftDown, isAltDown, isCtrlDown = im.IsKeyDown(shiftKeyIdx), im.IsKeyDown(altKeyIdx), im.IsKeyDown(ctrlKeyIdx)
local isCDown, isVDown, isDelDown = im.IsKeyDown(cKeyIdx), im.IsKeyDown(vKeyIdx), im.IsKeyDown(delKeyIdx)
mouseVel2D:set(mousePos.x - mouseLast.x, mousePos.y - mouseLast.y, 0.0)
local isShiftDown, isAltDown, isCtrlDown = im.IsKeyDown(shiftKeyIdx), im.IsKeyDown(altKeyIdx), im.IsKeyDown(ctrlKeyIdx)
local isCDown, isVDown, isDelDown = im.IsKeyDown(cKeyIdx), im.IsKeyDown(vKeyIdx), im.IsKeyDown(delKeyIdx)
local isShiftDown, isAltDown, isCtrlDown = im.IsKeyDown(shiftKeyIdx), im.IsKeyDown(altKeyIdx), im.IsKeyDown(ctrlKeyIdx)
local isCDown, isVDown, isDelDown = im.IsKeyDown(cKeyIdx), im.IsKeyDown(vKeyIdx), im.IsKeyDown(delKeyIdx)
local isShiftDown, isAltDown, isCtrlDown = im.IsKeyDown(shiftKeyIdx), im.IsKeyDown(altKeyIdx), im.IsKeyDown(ctrlKeyIdx)
local isCDown, isVDown, isDelDown = im.IsKeyDown(cKeyIdx), im.IsKeyDown(vKeyIdx), im.IsKeyDown(delKeyIdx)
local isShiftDown, isAltDown, isCtrlDown = im.IsKeyDown(shiftKeyIdx), im.IsKeyDown(altKeyIdx), im.IsKeyDown(ctrlKeyIdx)
local isCDown, isVDown, isDelDown = im.IsKeyDown(cKeyIdx), im.IsKeyDown(vKeyIdx), im.IsKeyDown(delKeyIdx)
@/lua/ge/extensions/editor/toolUtilities/ribbonInput.lua
end
if im.IsMouseClicked(0) and not im.IsKeyDown(altKeyIdx) then
if not isLeftNodePlaced then
-- Handle node deletion events.
if not isLeftNodePlaced and not isNodeDrag and im.IsKeyDown(delKeyIdx) then
if not hasDeletePressedRecently and out.nodeIdx > 0 and out.nodeIdx <= #nodes then
if useGizmo and not isLeftNodePlaced then
local isAltDown = im.IsKeyDown(altKeyIdx)
if isAltDown and isAltDown ~= lastAltDown then
@/lua/ge/extensions/editor/biomeTool.lua
end
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Escape)) then
imgui.CloseCurrentPopup()
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Enter)) then
syncSelectedBrushListFunc(enum_forestBrushItemZone.central)
end
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Escape)) then
imgui.CloseCurrentPopup()
end
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Enter)) then
syncSelectedBrushListFunc(enum_forestBrushItemZone.falloff)
end
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Escape)) then
imgui.CloseCurrentPopup()
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Enter)) then
syncSelectedBrushListFunc(enum_forestBrushItemZone.edge)
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Escape)) then
isDrawingLassoArea = false
@/lua/ge/extensions/editor/util/transformUtil.lua
onUpdate = function()
if im.IsKeyDown(im.GetKeyIndex(im.Key_Escape)) then
editor.selectEditMode(editor.editModes.objectSelect)
@/lua/ge/extensions/editor/dynamicDecals/layerStack.lua
-- TODO: Use input action instead of im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)) as 'Ctrl' modifier
if selectionData and selectionData[layer.uid] then
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), editor.color.beamng.Value, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.deselectLayer(im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)) and layer.uid or nil)
end
if editor.uiIconImageButton(editor.icons.near_me, im.ImVec2(tool.getIconSize(), tool.getIconSize()), nil, nil, nil, string.format("select##%s_%s", guiId, layer.uid)) then
selection.selectLayer(layer.uid, im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)))
end
@/lua/ge/extensions/editor/gen/ui.lua
row[#row + 1] = {'Z', '...'}
if im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
row = HTree[4]
@/lua/ge/extensions/editor/vehicleDetailViewer.lua
local wheel = im.GetIO().MouseWheel
local isShiftHeld = im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift))
local isCtrlHeld = im.IsKeyDown(im.GetKeyIndex(im.Key_ModCtrl))
local isShiftHeld = im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift))
local isCtrlHeld = im.IsKeyDown(im.GetKeyIndex(im.Key_ModCtrl))
@/lua/ge/extensions/editor/rallyEditor/drivelineTab.lua
local isShiftDown = im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift))
local isDelDown = im.IsKeyDown(im.GetKeyIndex(im.Key_Delete))
local isShiftDown = im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift))
local isDelDown = im.IsKeyDown(im.GetKeyIndex(im.Key_Delete))
local isMouseDown = im.IsMouseDown(0)
@/lua/ge/extensions/editor/gen/world.lua
local function inService()
return im.IsKeyDown(editor.keyModifiers.shift)
end
if U._PRD == 0 and im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
lo('?? wallSplit_HOR:')
--[[
elseif editor.keyModifiers.ctrl and not im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
lo('?? to_create:')
-- TOP SPLIT
lo('?? for_top:'..tostring(im.IsKeyDown(im.GetKeyIndex(im.Key_Z))))
-- lo('?? rc:'..id..':'..tostring(rayCast.object)) --..rayCast.object.name)
if cedit.cval['AltZ'] ~= nil then
-- if im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
intopchange = true
end
elseif not im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
-- lo('?? corner_DRAG:'..tostring(editor.keyModifiers.ctrl), true)
-- Z ------------
elseif im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
if scope == 'building' then
if editor.keyModifiers.shift then
-- if im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then -- or im.IsKeyDown(im.GetKeyIndex(im.Key_X)) then
indrag = true
if editor.keyModifiers.shift then
-- if im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then -- or im.IsKeyDown(im.GetKeyIndex(im.Key_X)) then
indrag = true
--[[
elseif not editor.keyModifiers.ctrl and not im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) and cmesh ~= nil then
if true then return end
if nm == 'theTerrain' and not indrag and editor.keyModifiers.ctrl and not im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
lo('?? to_create:')
cmouse = ray.pos + d*ray.dir
if im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
-- if editor.keyModifiers.ctrl then
forBuilding(desc, function(w, ij)
local dir = im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) and w.v or w.u
dir = dir:normalized()
local line = line2rect(t, base2world(desc, ij), w.u, w.v,
im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) and 1 or 2)
if line then
--[[
if im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
if ({wall=1})[scope] then
-- lo('?? weelresz:'..tostring(cedit.cval['AltZ'][3]))
-- if im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
-- if editor.keyModifiers.shift then
--------------------
if editor.keyModifiers.ctrl and im.IsKeyDown(im.GetKeyIndex(im.Key_Z)) then
-- lo('?? to_restoere:'..#asave..':'..tostring(cedit.mesh)..':'..tostring(inrollback))
if editor.keyModifiers.ctrl then
-- lo('?? for_CTRL:'..tostring(im.IsKeyDown(im.GetKeyIndex(im.Key_J))))
local desc = adesc[cedit.mesh]
local dir
if im.IsKeyDown(im.GetKeyIndex(im.Key_RightArrow)) then
dir = 1
end
if im.IsKeyDown(im.GetKeyIndex(im.Key_LeftArrow)) then
dir = -1
@/lua/ge/extensions/editor/roadArchitect.lua
-- Cache the (relevant) keyboard state.
local isCtrlDown = im.IsKeyDown(keyIdx.ctrl)
local isShiftDown = im.IsKeyDown(keyIdx.shift)
local isCtrlDown = im.IsKeyDown(keyIdx.ctrl)
local isShiftDown = im.IsKeyDown(keyIdx.shift)
local isAltDown = im.IsKeyDown(keyIdx.alt)
local isShiftDown = im.IsKeyDown(keyIdx.shift)
local isAltDown = im.IsKeyDown(keyIdx.alt)
local isADown = im.IsKeyDown(keyIdx.a)
local isAltDown = im.IsKeyDown(keyIdx.alt)
local isADown = im.IsKeyDown(keyIdx.a)
local isCDown = im.IsKeyDown(keyIdx.c)
local isADown = im.IsKeyDown(keyIdx.a)
local isCDown = im.IsKeyDown(keyIdx.c)
local isVDown = im.IsKeyDown(keyIdx.v)
local isCDown = im.IsKeyDown(keyIdx.c)
local isVDown = im.IsKeyDown(keyIdx.v)
local isDelDown = im.IsKeyDown(keyIdx.del)
local isVDown = im.IsKeyDown(keyIdx.v)
local isDelDown = im.IsKeyDown(keyIdx.del)
if not isCtrlDown then -- We only want CTRL to act once.
@/lua/ge/extensions/editor/sceneTree.lua
if hasDragDropPayload then
if imgui.IsKeyDown(imgui.GetKeyIndex(imgui.Key_Escape)) then
hasDragDropPayload = false
@/lua/ge/extensions/editor/resourceChecker.lua
if im.IsItemHovered() and im.IsMouseClicked(0) then
if not im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift)) then
isDoubleClicked = {}
if im.IsItemHovered() and im.IsMouseClicked(0) then
if not im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift)) then
isDoubleClicked = {}
if im.IsItemHovered() and im.IsMouseClicked(0) then
if not im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift)) then
isDoubleClicked = {}
if im.IsItemHovered() and im.IsMouseClicked(0) then
if not im.IsKeyDown(im.GetKeyIndex(im.Key_ModShift)) then
isDoubleClicked = {}
@/lua/ge/extensions/editor/dynamicDecals/textures.lua
local function handleTextureImageTileClicked(filePath, texturesFiles)
if im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModShift)) then
local sel = editor.selection["dynamicDecalTexture"]
end
selectTextureFile({filePath}, im.IsKeyDown(im.GetKeyIndex(im.Key_ReservedForModCtrl)))
end