Skip to content
This repository was archived by the owner on Feb 1, 2026. It is now read-only.

Commit 6161a24

Browse files
offalynneJujuAdamstabularelf
authored
v10.1 (#965)
* Add `InputBufferPressed()` * typo in `InputBindingSet()` Signed-off-by: Alynne <alviscera@gmail.com> * handle undefined for `__InputBindingIsThumbstick()` Signed-off-by: Alynne <alviscera@gmail.com> * Cluster validation (#957) * normalise `VirtualButton` debug vector * Provisional WASM support thanks @tabularelf * Block dysfunctional NSO controllers on Apple Mobile Signed-off-by: Alynne <alviscera@gmail.com> * Fix hotswap thrashing * Removes extraneous code from `InputPartySetJoin()` * Update gamepad data * Sets up new default `InputPartySetJoin()` behaviour * Replaced callstack check with a flag variable check, for better platform consistency (#963) * Switch 2 gamepad support Switch 2 icons Add Switch 2 GameChat button, Cleanup * Remove template strings * Switch 2 gamepads * Bump version --------- Signed-off-by: Alynne <alviscera@gmail.com> Co-authored-by: Juju Adams <julian.adams@email.com> Co-authored-by: TabularElf <tabularelf@gmail.com>
1 parent c6af0a0 commit 6161a24

File tree

35 files changed

+397
-801
lines changed

35 files changed

+397
-801
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p align="center"><img src="https://raw.githubusercontent.com/offalynne/input/main/LOGO.png" style="display:block; margin:auto; width:300px"></p>
22

3-
<h1 align="center">Input 10.0.9</h1>
3+
<h1 align="center">Input 10.1.0</h1>
44

5-
<p align="center">Comprehensive cross-platform input for GameMaker 2024.8 by <a href="https://www.jujuadams.com/" target="_blank">Juju Adams</a>, <a href="https://offalynne.neocities.org/">Alynne Keith</a>, and <a href="https://offalynne.github.io/Input/#/10.0/Credits">Friends</a></p>
5+
<p align="center">Comprehensive cross-platform input for GameMaker 2024.13 by <a href="https://www.jujuadams.com/" target="_blank">Juju Adams</a>, <a href="https://offalynne.neocities.org/">Alynne Keith</a>, and <a href="https://offalynne.github.io/Input/#/10.0/Credits">Friends</a></p>
66

77
&nbsp;
88

datafiles/gamecontrollerdb.txt

Lines changed: 179 additions & 162 deletions
Large diffs are not rendered by default.

input.yyp

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/InputBindingSet/InputBindingSet.gml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ function InputBindingSet(_forGamepad, _verbIndex, _binding, _alternate = 0, _pla
3939
var _prevBinding = _alternateArray[_alternate];
4040
_alternateArray[@ _alternate] = _binding;
4141

42-
if (_forGamepad && (_prevBinding != _binding) && (__InputBindingIsThumbstick(_binding) || __InputBindingIsThumbstick(_binding)))
42+
if (_forGamepad && (_prevBinding != _binding) && (__InputBindingIsThumbstick(_prevBinding) || __InputBindingIsThumbstick(_binding)))
4343
{
4444
__UpdateClusterThresholds();
4545
}
4646
}
47-
}
47+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Feather disable all
2+
3+
/// Returns if a verb has been pressed during the specified duration, measured in
4+
/// frames.
5+
///
6+
/// @param {Enum.INPUT_VERB,Real} verbIndex
7+
/// @param {Real} duration
8+
/// @param {Real} [playerIndex=0]
9+
10+
function InputBufferPressed(_verbIndex, _duration, _playerIndex = 0)
11+
{
12+
static _system = __InputSystem();
13+
static _playerArray = __InputSystemPlayerArray();
14+
15+
__INPUT_VALIDATE_PLAYER_INDEX
16+
17+
with(_playerArray[_playerIndex].__verbStateArray[_verbIndex])
18+
{
19+
return ((_system.__frame - __pressFrame) <= _duration);
20+
}
21+
}

scripts/InputBufferPressed/InputBufferPressed.yy

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/InputDefineCluster/InputDefineCluster.gml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ function InputDefineCluster(_clusterIndex, _verbUp, _verbRight, _verbDown, _verb
2828

2929
if (GM_build_type == "run")
3030
{
31-
var _callstack = debug_get_callstack(2);
32-
var _previous = _callstack[1];
33-
_previous = string_copy(_previous, 1, string_length("gml_Script___InputConfigVerbs"))
34-
35-
if (_previous != "gml_Script___InputConfigVerbs")
31+
if not (_system.__verbDefineAllowed)
3632
{
3733
__InputError("InputDefineCluster() must only be called in __InputConfigVerbs()");
3834
}

scripts/InputDefineVerb/InputDefineVerb.gml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ function InputDefineVerb(_verbIndex, _exportName, _kbmBinding, _gamepadBinding,
2727

2828
if (GM_build_type == "run")
2929
{
30-
var _callstack = debug_get_callstack(2);
31-
var _previous = _callstack[1];
32-
_previous = string_copy(_previous, 1, string_length("gml_Script___InputConfigVerbs"))
33-
34-
if (_previous != "gml_Script___InputConfigVerbs")
30+
if not (_system.__verbDefineAllowed)
3531
{
3632
__InputError("InputDefineVerb() must only be called in __InputConfigVerbs()");
3733
}

scripts/InputDirection/InputDirection.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ function InputDirection(_default, _clusterIndex, _playerIndex = 0)
1414

1515
with(_playerArray[_playerIndex])
1616
{
17+
__INPUT_VALIDATE_CLUSTER_INDEX
18+
1719
var _x = __clusterXArray[_clusterIndex];
1820
var _y = __clusterYArray[_clusterIndex];
1921

scripts/InputDistance/InputDistance.gml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ function InputDistance(_clusterIndex, _playerIndex = 0)
1212
__INPUT_VALIDATE_PLAYER_INDEX
1313

1414
with(_playerArray[_playerIndex])
15-
{
15+
{
16+
__INPUT_VALIDATE_CLUSTER_INDEX
17+
1618
return point_distance(0, 0, __clusterXArray[_clusterIndex], __clusterYArray[_clusterIndex]);
1719
}
1820
}

0 commit comments

Comments
 (0)