PnS key_released: missing key/characters attributes.

Official support for: bluecataudio.com
Post Reply New Topic
RELATED
PRODUCTS

Post

Hi guys :-)

here's another one.
Don't know if somebody has mentioned it already...at least I couldn't find messages about it.

key_released.key
and
key_released.character (tried also key_released.characters)

don't work. Whenever I use those attributes I receive errors like these:

- error: Error: 'key' is not a member of 'Kt::Event' in /Users/rudi/Documents/AudioDevel/Projects/PnSPlayground/Skins/LetiMix/main-body.inc(833:68)
- error: Error: 'characters' is not a member of 'Kt::Event' in /Users/rudi/Documents/AudioDevel/Projects/PnSPlayground/Skins/LetiMix/main-body.inc(833:119)

The event key_released works fine by itself, it's only the 2 attributes that don't.
With key_pressed, I can access the key and characters attributes, so it may be an issue with key_released only.

Excerpt of my code:

Code: Select all

<ACTION_TRIGGER event_ids="$id$_mouseDownPTS.key_pressed" script="main_keyPressed(uint($id$_mouseDownPTS.key_pressed.key),$id$_mouseDownPTS.key_pressed.characters);" requires="$id$_mouseDownPTS.key_pressed.key;$id$_mouseDownPTS.key_pressed.characters"/>
<ACTION_TRIGGER event_ids="$id$_mouseDownPTS.key_released" script="main_keyReleased(uint($id$_mouseDownPTS.key_released.key),$id$_mouseDownPTS.key_released.characters);" requires="$id$_mouseDownPTS.key_released.key;$id$_mouseDownPTS.key_released.characters"/>
As already said ... key_pressed works like a charm, key_released misses the 2 attributes.

Hope this suits you as description...

Cheers
Rudi
http://www.pulpoaudio.com
Virtual Percussion Instruments
email: pulpo@pulpoaudio.com

Post

If you are using these attributes in scripts, you need to make sure they are exposed, using the "requires" attribute in your script:

Code: Select all

requires="$id$_mouseDownPTS.key_released.key;$id$_mouseDownPTS.key_released.character"

Post

cool ! this works, thanks for the hint.

Just to understand .... is this a bug or works-as-designed ? I ask because for the key_pressed attributes I don't have to add anything in the "requires" element...
http://www.pulpoaudio.com
Virtual Percussion Instruments
email: pulpo@pulpoaudio.com

Post

It works the same way for both (it is similar to a linker that will strip unused symbols, except that it is not possible to detect required symbols automatically in Angelscript). I guess that these objects are used somewhere else for the key pressed event, that's why you do not need to require them again (but it's safer to do so).

Post Reply

Return to “Blue Cat Audio”