Skip to content

Commit

Permalink
rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
KilledByAPixel committed Jun 14, 2024
1 parent 01258e2 commit deb7a91
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 44 deletions.
38 changes: 24 additions & 14 deletions build/littlejs.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2547,23 +2547,33 @@ function inputUpdatePost()
///////////////////////////////////////////////////////////////////////////////
// Keyboard event handlers

onkeydown = (e)=>
{
if (debug && e.target != document.body) return;
e.repeat || (inputData[isUsingGamepad = 0][remapKey(e.which)] = 3);
preventDefaultInput && e.preventDefault();
}
onkeydown = (e)=>
{
if (debug && e.target != document.body) return;
if (!e.repeat)
{
inputData[isUsingGamepad = 0][e.which] = 3;
if (inputWASDEmulateDirection)
inputData[0][remapKey(e.which)] = 3;
}
preventDefaultInput && e.preventDefault();
}

onkeyup = (e)=>
{
if (debug && e.target != document.body) return;
inputData[0][remapKey(e.which)] = 4;
}
onkeyup = (e)=>
{
if (debug && e.target != document.body) return;
inputData[0][e.which] = 4;
if (inputWASDEmulateDirection)
inputData[0][remapKey(e.which)] = 4;
}

function remapKey(c)
{
return inputWASDEmulateDirection ?
c==87?38 : c==83?40 : c==65?37 : c==68?39 : c : c;
// handle remapping wasd keys to directions
function remapKey(c)
{
return inputWASDEmulateDirection ?
c==87?38 : c==83?40 : c==65?37 : c==68?39 : c : c;
}
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion build/littlejs.esm.min.js

Large diffs are not rendered by default.

38 changes: 24 additions & 14 deletions build/littlejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2547,23 +2547,33 @@ function inputUpdatePost()
///////////////////////////////////////////////////////////////////////////////
// Keyboard event handlers

onkeydown = (e)=>
{
if (debug && e.target != document.body) return;
e.repeat || (inputData[isUsingGamepad = 0][remapKey(e.which)] = 3);
preventDefaultInput && e.preventDefault();
}
onkeydown = (e)=>
{
if (debug && e.target != document.body) return;
if (!e.repeat)
{
inputData[isUsingGamepad = 0][e.which] = 3;
if (inputWASDEmulateDirection)
inputData[0][remapKey(e.which)] = 3;
}
preventDefaultInput && e.preventDefault();
}

onkeyup = (e)=>
{
if (debug && e.target != document.body) return;
inputData[0][remapKey(e.which)] = 4;
}
onkeyup = (e)=>
{
if (debug && e.target != document.body) return;
inputData[0][e.which] = 4;
if (inputWASDEmulateDirection)
inputData[0][remapKey(e.which)] = 4;
}

function remapKey(c)
{
return inputWASDEmulateDirection ?
c==87?38 : c==83?40 : c==65?37 : c==68?39 : c : c;
// handle remapping wasd keys to directions
function remapKey(c)
{
return inputWASDEmulateDirection ?
c==87?38 : c==83?40 : c==65?37 : c==68?39 : c : c;
}
}

///////////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion build/littlejs.min.js

Large diffs are not rendered by default.

38 changes: 24 additions & 14 deletions build/littlejs.release.js
Original file line number Diff line number Diff line change
Expand Up @@ -2170,23 +2170,33 @@ function inputUpdatePost()
///////////////////////////////////////////////////////////////////////////////
// Keyboard event handlers

onkeydown = (e)=>
{
if (debug && e.target != document.body) return;
e.repeat || (inputData[isUsingGamepad = 0][remapKey(e.which)] = 3);
preventDefaultInput && e.preventDefault();
}
onkeydown = (e)=>
{
if (debug && e.target != document.body) return;
if (!e.repeat)
{
inputData[isUsingGamepad = 0][e.which] = 3;
if (inputWASDEmulateDirection)
inputData[0][remapKey(e.which)] = 3;
}
preventDefaultInput && e.preventDefault();
}

onkeyup = (e)=>
{
if (debug && e.target != document.body) return;
inputData[0][remapKey(e.which)] = 4;
}
onkeyup = (e)=>
{
if (debug && e.target != document.body) return;
inputData[0][e.which] = 4;
if (inputWASDEmulateDirection)
inputData[0][remapKey(e.which)] = 4;
}

function remapKey(c)
{
return inputWASDEmulateDirection ?
c==87?38 : c==83?40 : c==65?37 : c==68?39 : c : c;
// handle remapping wasd keys to directions
function remapKey(c)
{
return inputWASDEmulateDirection ?
c==87?38 : c==83?40 : c==65?37 : c==68?39 : c : c;
}
}

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit deb7a91

Please sign in to comment.