View Issue Details

IDProjectCategoryView StatusLast Update
0000073Medieval EngineersEnhancementpublic2020-10-24 15:46
Reporterequinox Assigned Toequinox  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version0.7.2 
Target Version0.7.3.33D4BBFixed in Version0.7.3.33D4BB 
Summary0000073: Send analog input when below the pressed input
Description

Currently events only end up in the input context / bindings system are those that have a state of pressed, newly pressed, or released. For any analog input the input is only pressed when the value exceeds MyJoystickConstants.ANALOG_PRESSED_THRESHOLD = 0.5. This means that mods only have access to the upper half of any analog input range.

The input context / bindings system does allow you to register callbacks for MyInputState.Up, however any bindings in this state (which is < 0.5 for analog) gets discarded in MyInputProcessor. Forwarding any analog input event that has any value less than 0.5 with MyInputState.Up to the input context / bindings system seems like a reasonable way to handle this.

TagsNo tags attached.

Relationships

child of 0000071 resolvedequinox Joystick improvements  

Activities

equinox

2020-10-24 00:28

administrator   #~0000030

Last edited: 2020-10-24 00:28

Proposed API is just:

private void Setup() 
{
    m_inputContext.RegisterAction(MyStringHash.GetOrCompute("MoveForward"), MyInputStateFlags.AnyAnalog, MoveForward);
}

private void MoveForward(ref MyInputContext.ActionEvent action)
{
    // action.AnalogValue will contain any input performed on the analog input, and will return one zero before the event handler stops getting invoked
}

Issue History

Date Modified Username Field Change
2020-10-23 23:45 equinox New Issue
2020-10-23 23:45 equinox Relationship added child of 0000071
2020-10-23 23:45 equinox Assigned To => equinox
2020-10-23 23:45 equinox Status new => assigned
2020-10-23 23:45 equinox Status assigned => in progress
2020-10-23 23:46 equinox Target Version => 0.7.3.33D4BB
2020-10-24 00:28 equinox Note Added: 0000030
2020-10-24 00:28 equinox Note Edited: 0000030
2020-10-24 15:46 equinox Status in progress => resolved
2020-10-24 15:46 equinox Resolution open => fixed
2020-10-24 15:46 equinox Fixed in Version => 0.7.3.33D4BB