basically im looking at the time between when the player attacks,
i want to be able to detect if the user has pressed the attack button a set time after the last attack (within a given time frame),
so if the user repetitively hacks at the attack button (say twice before the animation of the first attack finishes) the script will know.
but it seems that when i looked at the c++ files that define IsKeyPressed() it uses input of the GameState, not raw input.
in the C++ files that define the scripts has a flag argument that lets you define which state to use, allowing the raw input from the user but ...
it appears to be auto set to Game state (0) within the header and if within the script you pass a second argument as it appears in the skse c++ file the script tells you you have two many arugments.
from papyrusInput.cpp found in src\skse\skse:
bool IsKeyPressed(StaticFunctionTag* thisInput, UInt32 dxKeycode){ return DIHookControl::GetSingleton().IsKeyPressed(dxKeycode);}
then within hooks_DIrectInput8Create.cpp (same folder):
bool DIHookControl::_IsKeyPressed(KeyInfo* info, UInt32 flags){bool result = false;//bool isMouseButton = keycode >= kMacro_MouseButtonOffset;// data sourcesif(flags & kFlag_GameState) result |= info->gameState;if(flags & kFlag_RawState) result |= info->rawState;if(flags & kFlag_InsertedState) result |= info->insertedState;// modifiersbool disable = false;if((flags & kFlag_IgnoreDisabled_User) && info->userDisable) disable = true;if((flags & kFlag_IgnoreDisabled_Script) && info->scriptDisable) disable = true;if(disable) result = false;return result;}bool DIHookControl::IsKeyPressed(UInt32 keycode, UInt32 flags){if(keycode >= kMaxMacros) return false;// default modeif(!flags) flags = kFlag_DefaultBackCompat;KeyInfo * info = &m_keys[keycode];return _IsKeyPressed(info, flags);}
so from this as far as i can tell the script version calls the isKeyPressed from PapyrusInput.cpp,
this calls the isKeyPressed in Hooks_directInput8Create.cpp, which will call _IsKeyPressed defined just above it
not sure if i have this right of if there is an easier way to just get the raw time of the button pressed when i used the code as it appears above but replaced trace with debug.Notification() (used notification instead to get instant feed back) it appears to disregard presses made while the animation of the attack occurs, leads me to believe that the input is check after the game has filtered it.