[FEATURE REQUEST] Properly detect last symbol pressed

Discussion and feedback on Construct 2

Post » Wed Mar 29, 2017 7:37 am

PROBLEM: Construct 2 can't detect symbols like: ă î ș ț
WHY?: Construct 2 uses only last key code to detect last key pressed. This is 0 for all special symbols above

SOLUTION:
http://javascript.info/tutorial/keyboard-events

From this url:
The only event which reliably provides the character is keypress.


So here’s the function to get all a symbol from keypress event:
Code: Select all
// event.type must be keypress
function getChar(event) {
  if (event.which == null) {
    return String.fromCharCode(event.keyCode) // IE
  } else if (event.which!=0 && event.charCode!=0) {
    return String.fromCharCode(event.which)   // the rest
  } else {
    return null // special key
  }
}



I would like to request that this would be implement in Construct 2 as a keyboard expression: Keyboard.lastsymbolpressed.

I hope this is not to hard to implement
B
32
S
8
G
4
Posts: 149
Reputation: 3,715

Return to Construct 2 General

Who is online

Users browsing this forum: BadMario and 4 guests