From 7c2744f86fd7be80b16e0d9a961ea8a9e02400ee Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Thu, 11 Jan 2024 13:41:33 +0100 Subject: [PATCH 1/5] core: Implement restrict for EditText EditTextRestrict models the `restrict` property, which is used to specify which characters the user is allowed to type. --- core/src/display_object/edit_text.rs | 298 +++++++++++++++++++++++---- 1 file changed, 255 insertions(+), 43 deletions(-) diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index d4083c807ed1..38eed63f63e0 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -34,6 +34,7 @@ use gc_arena::{Collect, Gc, GcCell, Mutation}; use ruffle_render::commands::CommandHandler; use ruffle_render::shape_utils::DrawCommand; use ruffle_render::transform::Transform; +use std::collections::VecDeque; use std::{cell::Ref, cell::RefMut, sync::Arc}; use swf::{Color, ColorTransform, Twips}; @@ -168,6 +169,10 @@ pub struct EditTextData<'gc> { /// Whether this EditText represents an AVM2 TextLine. is_tlf: bool, + + /// Restrict what characters the user may input. + #[collect(require_static)] + restrict: EditTextRestrict, } impl<'gc> EditTextData<'gc> { @@ -334,6 +339,7 @@ impl<'gc> EditText<'gc> { scroll: 1, max_chars: swf_tag.max_length().unwrap_or_default() as i32, is_tlf: false, + restrict: EditTextRestrict::allow_all(), }, )); @@ -502,6 +508,14 @@ impl<'gc> EditText<'gc> { self.relayout(context); } + pub fn restrict(self) -> Option { + return self.0.read().restrict.value().map(Into::into); + } + + pub fn set_restrict(self, text: Option<&WStr>, context: &mut UpdateContext<'_, 'gc>) { + self.0.write(context.gc_context).restrict = EditTextRestrict::from(text); + } + pub fn set_multiline(self, is_multiline: bool, context: &mut UpdateContext<'_, 'gc>) { self.0 .write(context.gc_context) @@ -1487,57 +1501,58 @@ impl<'gc> EditText<'gc> { } pub fn text_input(self, character: char, context: &mut UpdateContext<'_, 'gc>) { - if self.0.read().flags.contains(EditTextFlag::READ_ONLY) { + if self.0.read().flags.contains(EditTextFlag::READ_ONLY) + || character.is_control() + || self.available_chars() == 0 + { return; } - if let Some(selection) = self.selection() { - let mut changed = false; - let mut cancelled = false; - if !character.is_control() && self.available_chars() > 0 { - if let Avm2Value::Object(target) = self.object2() { - let character_string = - AvmString::new_utf8(context.gc_context, character.to_string()); - - let mut activation = Avm2Activation::from_nothing(context.reborrow()); - let text_evt = Avm2EventObject::text_event( - &mut activation, - "textInput", - character_string, - true, - true, - ); - Avm2::dispatch_event(&mut activation.context, text_evt, target); + let Some(selection) = self.selection() else { + return; + }; - cancelled = text_evt.as_event().unwrap().is_cancelled(); - } + let Some(character) = self.0.read().restrict.to_allowed(character) else { + return; + }; - if !cancelled { - self.replace_text( - selection.start(), - selection.end(), - &WString::from_char(character), - context, - ); - let new_pos = selection.start() + character.len_utf8(); - self.set_selection( - Some(TextSelection::for_position(new_pos)), - context.gc_context, - ); - changed = true; - } - } + if let Avm2Value::Object(target) = self.object2() { + let character_string = AvmString::new_utf8(context.gc_context, character.to_string()); - if changed { - let mut activation = Avm1Activation::from_nothing( - context.reborrow(), - ActivationIdentifier::root("[Propagate Text Binding]"), - self.into(), - ); - self.propagate_text_binding(&mut activation); - self.on_changed(&mut activation); + let mut activation = Avm2Activation::from_nothing(context.reborrow()); + let text_evt = Avm2EventObject::text_event( + &mut activation, + "textInput", + character_string, + true, + true, + ); + Avm2::dispatch_event(&mut activation.context, text_evt, target); + + if text_evt.as_event().unwrap().is_cancelled() { + return; } } + + self.replace_text( + selection.start(), + selection.end(), + &WString::from_char(character), + context, + ); + let new_pos = selection.start() + character.len_utf8(); + self.set_selection( + Some(TextSelection::for_position(new_pos)), + context.gc_context, + ); + + let mut activation = Avm1Activation::from_nothing( + context.reborrow(), + ActivationIdentifier::root("[Propagate Text Binding]"), + self.into(), + ); + self.propagate_text_binding(&mut activation); + self.on_changed(&mut activation); } fn initialize_as_broadcaster(&self, activation: &mut Avm1Activation<'_, 'gc>) { @@ -2321,3 +2336,200 @@ impl TextSelection { self.to == self.from } } + +#[derive(Clone, Debug)] +struct EditTextRestrict { + /// Original string value. + value: Option, + + /// List of intervals (inclusive, inclusive) with allowed characters. + allowed: Vec<(char, char)>, + + /// List of intervals (inclusive, inclusive) with disallowed characters. + disallowed: Vec<(char, char)>, +} + +enum EditTextRestrictToken { + Char(char), + Range, + Caret, +} + +impl EditTextRestrict { + const INTERVAL_ALL: (char, char) = ('\0', char::MAX); + + pub fn allow_all() -> Self { + Self { + value: None, + allowed: vec![Self::INTERVAL_ALL], + disallowed: vec![], + } + } + + pub fn allow_none() -> Self { + Self { + value: Some(WString::new()), + allowed: vec![], + disallowed: vec![], + } + } + + pub fn from(value: Option<&WStr>) -> Self { + match value { + None => Self::allow_all(), + Some(string) => Self::from_string(string), + } + } + + pub fn from_string(string: &WStr) -> Self { + if string.is_empty() { + return Self::allow_none(); + } + + let mut tokens = Self::tokenize_restrict(string); + let mut allowed: Vec<(char, char)> = vec![]; + let mut disallowed: Vec<(char, char)> = vec![]; + + Self::parse_restrict(&mut tokens, &mut allowed, &mut disallowed); + + Self { + value: Some(string.into()), + allowed, + disallowed, + } + } + + fn tokenize_restrict(string: &WStr) -> VecDeque { + let mut characters: VecDeque = string + .chars() + .map(|c| c.unwrap_or(char::REPLACEMENT_CHARACTER)) + .collect::>(); + let mut tokens: VecDeque = VecDeque::with_capacity(characters.len()); + + while !characters.is_empty() { + match characters.pop_front().unwrap() { + // Handle escapes: \\, \-, \^. + // In fact, other escapes also work, so that \a is equivalent to a, not to \\a. + '\\' => { + if let Some(escaped) = characters.pop_front() { + tokens.push_back(EditTextRestrictToken::Char(escaped)); + } else { + // Ignore truncated escapes (when the string ends with \). + } + } + '^' => { + tokens.push_back(EditTextRestrictToken::Caret); + } + '-' => { + tokens.push_back(EditTextRestrictToken::Range); + } + c => { + tokens.push_back(EditTextRestrictToken::Char(c)); + } + } + } + + tokens + } + + fn parse_restrict( + tokens: &mut VecDeque, + allowed: &mut Vec<(char, char)>, + disallowed: &mut Vec<(char, char)>, + ) { + let mut current_intervals: Vec<(char, char)> = vec![]; + let mut last_char: Option = None; + let mut now_allowing = true; + while !tokens.is_empty() { + last_char = match tokens.pop_front().unwrap() { + EditTextRestrictToken::Char(c) => { + current_intervals.push((c, c)); + Some(c) + } + EditTextRestrictToken::Caret => { + if now_allowing { + if current_intervals.is_empty() && allowed.is_empty() { + // If restrict starts with ^, we are assuming that + // all characters are allowed and disallowing from that. + allowed.append(&mut vec![Self::INTERVAL_ALL]); + } else { + allowed.append(&mut current_intervals); + } + } else { + disallowed.append(&mut current_intervals); + } + + // Caret according to the documentation indicates + // that we are now disallowing characters. + // In reality it just switches allowing/disallowing. + now_allowing = !now_allowing; + None + } + EditTextRestrictToken::Range => { + let range_start = if let Some(last_char) = last_char { + current_intervals.pop(); + last_char + } else { + // When the range is truncated from the left side (-z), + // it is equivalent to \0-z. + '\0' + }; + let range_end; + if let Some(EditTextRestrictToken::Char(c)) = tokens.front() { + range_end = *c; + tokens.pop_front(); + } else { + // When the range is truncated from the right side (a-), + // it is equivalent to the first character (a). + range_end = range_start; + } + // If the range a-z is inverted (z-a), it is equivalent to + // the first character only (z). + current_intervals.push((range_start, range_end.max(range_start))); + None + } + } + } + + if now_allowing { + allowed.append(&mut current_intervals); + } else { + disallowed.append(&mut current_intervals); + } + } + + pub fn value(&self) -> Option<&WStr> { + self.value.as_deref() + } + + pub fn is_allowed(&self, character: char) -> bool { + self.intervals_contain(character, &self.allowed) + && !self.intervals_contain(character, &self.disallowed) + } + + fn intervals_contain(&self, character: char, intervals: &Vec<(char, char)>) -> bool { + for interval in intervals { + if self.interval_contains(character, interval) { + return true; + } + } + false + } + + #[inline] + fn interval_contains(&self, character: char, interval: &(char, char)) -> bool { + character >= interval.0 && character <= interval.1 + } + + pub fn to_allowed(&self, character: char) -> Option { + if self.is_allowed(character) { + Some(character) + } else if self.is_allowed(character.to_ascii_uppercase()) { + Some(character.to_ascii_uppercase()) + } else if self.is_allowed(character.to_ascii_lowercase()) { + Some(character.to_ascii_lowercase()) + } else { + None + } + } +} From 7411c8f4a1935b619b3fcc8a345dcc0fb1901435 Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Thu, 11 Jan 2024 13:37:36 +0100 Subject: [PATCH 2/5] avm1: Implement TextField.restrict --- core/src/avm1/globals/text_field.rs | 34 + .../swfs/avm1/edittext_restrict/input.json | 1106 +++++++++++++++++ .../swfs/avm1/edittext_restrict/output.txt | 191 +++ .../tests/swfs/avm1/edittext_restrict/test.as | 101 ++ .../swfs/avm1/edittext_restrict/test.swf | Bin 0 -> 600 bytes .../swfs/avm1/edittext_restrict/test.toml | 1 + 6 files changed, 1433 insertions(+) create mode 100644 tests/tests/swfs/avm1/edittext_restrict/input.json create mode 100644 tests/tests/swfs/avm1/edittext_restrict/output.txt create mode 100644 tests/tests/swfs/avm1/edittext_restrict/test.as create mode 100644 tests/tests/swfs/avm1/edittext_restrict/test.swf create mode 100644 tests/tests/swfs/avm1/edittext_restrict/test.toml diff --git a/core/src/avm1/globals/text_field.rs b/core/src/avm1/globals/text_field.rs index e18840328ca0..f83840667990 100644 --- a/core/src/avm1/globals/text_field.rs +++ b/core/src/avm1/globals/text_field.rs @@ -78,6 +78,7 @@ const PROTO_DECLS: &[Declaration] = declare_properties! { "maxChars" => property(tf_getter!(max_chars), tf_setter!(set_max_chars)); "multiline" => property(tf_getter!(multiline), tf_setter!(set_multiline)); "password" => property(tf_getter!(password), tf_setter!(set_password)); + "restrict" => property(tf_getter!(restrict), tf_setter!(set_restrict)); "scroll" => property(tf_getter!(scroll), tf_setter!(set_scroll)); "selectable" => property(tf_getter!(selectable), tf_setter!(set_selectable)); "text" => property(tf_getter!(text), tf_setter!(set_text)); @@ -859,3 +860,36 @@ fn set_filters<'gc>( this.set_filters(activation.context.gc_context, filters); Ok(()) } + +fn restrict<'gc>( + this: EditText<'gc>, + activation: &mut Activation<'_, 'gc>, +) -> Result, Error<'gc>> { + match this.restrict() { + Some(value) => Ok(AvmString::new(activation.context.gc_context, value).into()), + None => Ok(Value::Null), + } +} + +fn set_restrict<'gc>( + this: EditText<'gc>, + activation: &mut Activation<'_, 'gc>, + value: Value<'gc>, +) -> Result<(), Error<'gc>> { + match value { + Value::Undefined | Value::Null => { + this.set_restrict(None, &mut activation.context); + } + _ => { + let text = value.coerce_to_string(activation)?; + if text.is_empty() { + // According to docs, an empty string means that you cannot enter any character, + // but according to reality, an empty string is equivalent to null in AVM1. + this.set_restrict(None, &mut activation.context); + } else { + this.set_restrict(Some(&text), &mut activation.context); + } + } + }; + Ok(()) +} diff --git a/tests/tests/swfs/avm1/edittext_restrict/input.json b/tests/tests/swfs/avm1/edittext_restrict/input.json new file mode 100644 index 000000000000..56aead6e37e8 --- /dev/null +++ b/tests/tests/swfs/avm1/edittext_restrict/input.json @@ -0,0 +1,1106 @@ +[ + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 } +] diff --git a/tests/tests/swfs/avm1/edittext_restrict/output.txt b/tests/tests/swfs/avm1/edittext_restrict/output.txt new file mode 100644 index 000000000000..377d5c1e2996 --- /dev/null +++ b/tests/tests/swfs/avm1/edittext_restrict/output.txt @@ -0,0 +1,191 @@ +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: 'undefined' +Restrict get: 'null' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: 'null' +Restrict get: 'null' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: '' +Restrict get: 'null' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: 'false' +Restrict get: 'false' +Text: 'aa' +==================== +Restrict set: '1' +Restrict get: '1' +Text: '1' +==================== +Restrict set: 'true' +Restrict get: 'true' +Text: '' +==================== +Restrict set: '0.1' +Restrict get: '0.1' +Text: '01' +==================== +Restrict set: 'NaN' +Restrict get: 'NaN' +Text: 'aa' +==================== +Restrict set: '[object Object]' +Restrict get: '[object Object]' +Text: 'bcbc ' +==================== +Restrict set: 'aB*Δ' +Restrict get: 'aB*Δ' +Text: 'aBaB*Δ' +==================== +Restrict set: 'aa' +Restrict get: 'aa' +Text: 'aa' +==================== +Restrict set: 'a-z' +Restrict get: 'a-z' +Text: 'abcabc' +==================== +Restrict set: 'A-Z' +Restrict get: 'A-Z' +Text: 'ABCABC' +==================== +Restrict set: 'a-bA' +Restrict get: 'a-bA' +Text: 'abAb' +==================== +Restrict set: 'a-' +Restrict get: 'a-' +Text: 'aa' +==================== +Restrict set: '-b' +Restrict get: '-b' +Text: 'abCABC012^\-* &' +==================== +Restrict set: 'b-a' +Restrict get: 'b-a' +Text: 'bb' +==================== +Restrict set: 'A-z' +Restrict get: 'A-z' +Text: 'abcABC^\' +==================== +Restrict set: '-' +Restrict get: '-' +Text: '' +==================== +Restrict set: '--' +Restrict get: '--' +Text: '' +==================== +Restrict set: '---' +Restrict get: '---' +Text: '' +==================== +Restrict set: '----' +Restrict get: '----' +Text: '' +==================== +Restrict set: '-----' +Restrict get: '-----' +Text: '' +==================== +Restrict set: '-----b' +Restrict get: '-----b' +Text: 'abCABC012^\-* &' +==================== +Restrict set: 'b-----' +Restrict get: 'b-----' +Text: 'bb' +==================== +Restrict set: 'a-b-c' +Restrict get: 'a-b-c' +Text: 'abcABC012^\-* &' +==================== +Restrict set: 'a-b-A' +Restrict get: 'a-b-A' +Text: 'abAb012-* &' +==================== +Restrict set: 'a-a-b' +Restrict get: 'a-a-b' +Text: 'abCABC012^\-* &' +==================== +Restrict set: '\\-\^' +Restrict get: '\\-\^' +Text: '^\' +==================== +Restrict set: '\^-\\' +Restrict get: '\^-\\' +Text: '^' +==================== +Restrict set: '^' +Restrict get: '^' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: '^^' +Restrict get: '^^' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: '\^a' +Restrict get: '\^a' +Text: 'aa^' +==================== +Restrict set: '^\^' +Restrict get: '^\^' +Text: 'abcABC012\-* &ąδłĄΔŁß' +==================== +Restrict set: '^aą' +Restrict get: '^aą' +Text: 'AbcABC012^\-* &δłĄΔŁß' +==================== +Restrict set: 'a^b^c' +Restrict get: 'a^b^c' +Text: 'acac' +==================== +Restrict set: 'a^b^c^A^B' +Restrict get: 'a^b^c^A^B' +Text: 'aBcaBc' +==================== +Restrict set: 'a-zA-Z^bC' +Restrict get: 'a-zA-Z^bC' +Text: 'aBcABc' +==================== +Restrict set: 'a-zA-Z^' +Restrict get: 'a-zA-Z^' +Text: 'abcABC' +==================== +Restrict set: '\-' +Restrict get: '\-' +Text: '-' +==================== +Restrict set: 'a\-z' +Restrict get: 'a\-z' +Text: 'aa-' +==================== +Restrict set: '\\' +Restrict get: '\\' +Text: '\' +==================== +Restrict set: '\^' +Restrict get: '\^' +Text: '^' +==================== +Restrict set: '\ab' +Restrict get: '\ab' +Text: 'abab' +==================== +Restrict set: 'a\' +Restrict get: 'a\' +Text: 'aa' +==================== +Restrict set: ' -~' +Restrict get: ' -~' +Text: 'abcABC012^\-* &' +==================== +Restrict set: 'α-ω' +Restrict get: 'α-ω' +Text: 'δ' +==================== +No more restricts diff --git a/tests/tests/swfs/avm1/edittext_restrict/test.as b/tests/tests/swfs/avm1/edittext_restrict/test.as new file mode 100644 index 000000000000..2372afe19fbe --- /dev/null +++ b/tests/tests/swfs/avm1/edittext_restrict/test.as @@ -0,0 +1,101 @@ +// https://open-flash.github.io/mirrors/as2-language-reference/TextField.html#restrict +// There is one TextField named "text", which receives the text input. +// We are changing its "restrict" property with various values (variable "restricts"). +// When we receive "KeyDown" with the given code, we print +// the actual text and switch the restrict to the next one. +// For each restrict we are testing the following values: +// a,b,c — lowercase ASCII letters +// A,B,C — uppercase ASCII letters +// 0,1,2 — digits +// ^,\,- — special characters with a meaning +// *, ,& — other special characters +// ą,δ,ł — lowercase non-ASCII letters +// Ą,Δ,Ł — uppercase non-ASCII letters +// ß — a German letter with a controversial uppercase form +// When checking the test manually, one can copy the text, and keep pressing +// Ctrl-V, ESC, Ctrl-V, ESC, ... until all restricts are tested. +// Copy-pastable text: "abcABC012^\-* &ąδłĄΔŁß" + +var restricts = [ + // different empty values + undefined, + null, + "", + false, + // non-empty non-string values + 1, + true, + 0.1, + NaN, + new Object(), + // only selected chars + "aB*Δ", + "aa", + // ASCII ranges + "a-z", + "A-Z", + "a-bA", + // non-standard ranges + "a-", + "-b", + "b-a", + "A-z", + "-", + "--", + "---", + "----", + "-----", + "-----b", + "b-----", + "a-b-c", + "a-b-A", + "a-a-b", + "\\\\-\\^", + "\\^-\\\\", + // various behaviors with caret ^ + "^", + "^^", + "\\^a", + "^\\^", + "^aą", + "a^b^c", + "a^b^c^A^B", + "a-zA-Z^bC", + "a-zA-Z^", + // escapes + "\\-", + "a\\-z", + "\\\\", + "\\^", + "\\ab", + "a\\", + "\u0020-\u007E", + // unicode range + "α-ω" +]; + +var currentRestrict = -1; + +function nextRestrict() { + trace("Text: '" + text.text + "'"); + trace("===================="); + text.text = ""; + currentRestrict += 1; + if (restricts.length <= currentRestrict) { + trace("No more restricts"); + return; + } + text.restrict = restricts[currentRestrict]; + trace("Restrict set: '" + restricts[currentRestrict] + "'"); + trace("Restrict get: '" + text.restrict + "'"); +} + +var listener = new Object(); +listener.onKeyDown = function() { + if (Key.getCode() == 27) { + nextRestrict(); + } +}; +Key.addListener(listener); + +Selection.setFocus(text); diff --git a/tests/tests/swfs/avm1/edittext_restrict/test.swf b/tests/tests/swfs/avm1/edittext_restrict/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..b8306769ca2105505dfe75399eea079f06b07bc7 GIT binary patch literal 600 zcmV-e0;l~$S5pU41ONbdoNba#PZL2H$N$@RM8(#ZqExAO~)!XeNq-9$*D{mEo6D;}j9V}*95|#xXgsNbg z!epKlwxTWanl;#h3z|0i27(U)d3CidBy=LP@=97~3y>1BFth&|75jx#^HG*%pte)5 zJFZ{t&V*-b*v0I0F!VH*|Ff{|xSRfSl)darukK{~@6kJJ5_@P(ZX`mHCLc<_JM3{&W zQ6fgfi3Bl193n=E!^9EdC^1GHBa%dlI8K}(P7^u#W93V`-BwD}V2}|6MRnwrmVuD^!t~53PhpAj z3{CYzcb4{&!w(63*NIn&S>5Msxx`JBa@?-v20Z$TN>Gu=^cpDX;h>}D%7Je)mHHaO zs4jm!$EF_iOWo+l&t%HF Date: Thu, 11 Jan 2024 13:38:07 +0100 Subject: [PATCH 3/5] avm2: Implement TextField.restrict --- .../src/avm2/globals/flash/text/text_field.rs | 29 +- .../tests/swfs/avm2/edittext_restrict/Test.as | 107 ++ .../swfs/avm2/edittext_restrict/input.json | 1106 +++++++++++++++++ .../swfs/avm2/edittext_restrict/output.txt | 191 +++ .../swfs/avm2/edittext_restrict/test.swf | Bin 0 -> 1612 bytes .../swfs/avm2/edittext_restrict/test.toml | 1 + 6 files changed, 1428 insertions(+), 6 deletions(-) create mode 100644 tests/tests/swfs/avm2/edittext_restrict/Test.as create mode 100644 tests/tests/swfs/avm2/edittext_restrict/input.json create mode 100644 tests/tests/swfs/avm2/edittext_restrict/output.txt create mode 100644 tests/tests/swfs/avm2/edittext_restrict/test.swf create mode 100644 tests/tests/swfs/avm2/edittext_restrict/test.toml diff --git a/core/src/avm2/globals/flash/text/text_field.rs b/core/src/avm2/globals/flash/text/text_field.rs index fc9199968e63..79afb2238d59 100644 --- a/core/src/avm2/globals/flash/text/text_field.rs +++ b/core/src/avm2/globals/flash/text/text_field.rs @@ -1325,18 +1325,35 @@ pub fn set_mouse_wheel_enabled<'gc>( pub fn get_restrict<'gc>( activation: &mut Activation<'_, 'gc>, - _this: Object<'gc>, + this: Object<'gc>, _args: &[Value<'gc>], ) -> Result, Error<'gc>> { - avm2_stub_getter!(activation, "flash.text.TextField", "restrict"); - Ok(Value::Null) + if let Some(this) = this + .as_display_object() + .and_then(|this| this.as_edit_text()) + { + return match this.restrict() { + Some(value) => Ok(AvmString::new(activation.context.gc_context, value).into()), + None => Ok(Value::Null), + }; + } + + Ok(Value::Undefined) } pub fn set_restrict<'gc>( activation: &mut Activation<'_, 'gc>, - _this: Object<'gc>, - _args: &[Value<'gc>], + this: Object<'gc>, + args: &[Value<'gc>], ) -> Result, Error<'gc>> { - avm2_stub_setter!(activation, "flash.text.TextField", "restrict"); + if let Some(this) = this + .as_display_object() + .and_then(|this| this.as_edit_text()) + { + this.set_restrict( + args.try_get_string(activation, 0)?.as_deref(), + &mut activation.context, + ); + } Ok(Value::Undefined) } diff --git a/tests/tests/swfs/avm2/edittext_restrict/Test.as b/tests/tests/swfs/avm2/edittext_restrict/Test.as new file mode 100644 index 000000000000..ae97c5f34f69 --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_restrict/Test.as @@ -0,0 +1,107 @@ +// https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#restrict +// See the analogous test from avm1 for description. + +package { + import flash.display.Sprite; + import flash.display.Stage; + import flash.events.Event; + import flash.events.KeyboardEvent; + import flash.ui.Keyboard; + import flash.text.TextField; + + public class Test extends Sprite { + private var player:Sprite; + private var text:TextField; + + private var currentRestrict:int = -1; + private var restricts:Array = [ + // different empty values + undefined, + null, + "", + false, + // non-empty non-string values + 1, + true, + 0.1, + NaN, + new Object(), + // only selected chars + "aB*Δ", + "aa", + // ASCII ranges + "a-z", + "A-Z", + "a-bA", + // non-standard ranges + "a-", + "-b", + "b-a", + "A-z", + "-", + "--", + "---", + "----", + "-----", + "-----b", + "b-----", + "a-b-c", + "a-b-A", + "a-a-b", + "\\\\-\\^", + "\\^-\\\\", + // various behaviors with caret ^ + "^", + "^^", + "\\^a", + "^\\^", + "^aą", + "a^b^c", + "a^b^c^A^B", + "a-zA-Z^bC", + "a-zA-Z^", + // escapes + "\\-", + "a\\-z", + "\\\\", + "\\^", + "\\ab", + "a\\", + "\u0020-\u007E", + // unicode range + "α-ω" + ]; + + public function Test() { + text = new TextField(); + text.border = true; + text.width = 200; + text.height = 20; + text.type = "input"; + addChild(text); + + stage.focus = text; + stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressedDown); + } + + private function keyPressedDown(event:KeyboardEvent):void { + if (event.keyCode == 27) { + nextRestrict(); + } + } + + private function nextRestrict():void { + trace("Text: '" + text.text + "'"); + trace("===================="); + text.text = ""; + currentRestrict += 1; + if (restricts.length <= currentRestrict) { + trace("No more restricts"); + return; + } + text.restrict = restricts[currentRestrict]; + trace("Restrict set: '" + restricts[currentRestrict] + "'"); + trace("Restrict get: '" + text.restrict + "'"); + } + } +} diff --git a/tests/tests/swfs/avm2/edittext_restrict/input.json b/tests/tests/swfs/avm2/edittext_restrict/input.json new file mode 100644 index 000000000000..56aead6e37e8 --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_restrict/input.json @@ -0,0 +1,1106 @@ +[ + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "TextInput", "codepoint": "a" }, + { "type": "TextInput", "codepoint": "b" }, + { "type": "TextInput", "codepoint": "c" }, + { "type": "TextInput", "codepoint": "A" }, + { "type": "TextInput", "codepoint": "B" }, + { "type": "TextInput", "codepoint": "C" }, + { "type": "TextInput", "codepoint": "0" }, + { "type": "TextInput", "codepoint": "1" }, + { "type": "TextInput", "codepoint": "2" }, + { "type": "TextInput", "codepoint": "^" }, + { "type": "TextInput", "codepoint": "\\" }, + { "type": "TextInput", "codepoint": "-" }, + { "type": "TextInput", "codepoint": "*" }, + { "type": "TextInput", "codepoint": " " }, + { "type": "TextInput", "codepoint": "&" }, + { "type": "TextInput", "codepoint": "ą" }, + { "type": "TextInput", "codepoint": "δ" }, + { "type": "TextInput", "codepoint": "ł" }, + { "type": "TextInput", "codepoint": "Ą" }, + { "type": "TextInput", "codepoint": "Δ" }, + { "type": "TextInput", "codepoint": "Ł" }, + { "type": "TextInput", "codepoint": "ß" }, + { "type": "KeyDown", "key_code": 27 } +] diff --git a/tests/tests/swfs/avm2/edittext_restrict/output.txt b/tests/tests/swfs/avm2/edittext_restrict/output.txt new file mode 100644 index 000000000000..a405fcab375f --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_restrict/output.txt @@ -0,0 +1,191 @@ +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: 'undefined' +Restrict get: 'null' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: 'null' +Restrict get: 'null' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: '' +Restrict get: '' +Text: '' +==================== +Restrict set: 'false' +Restrict get: 'false' +Text: 'aa' +==================== +Restrict set: '1' +Restrict get: '1' +Text: '1' +==================== +Restrict set: 'true' +Restrict get: 'true' +Text: '' +==================== +Restrict set: '0.1' +Restrict get: '0.1' +Text: '01' +==================== +Restrict set: 'NaN' +Restrict get: 'NaN' +Text: 'aa' +==================== +Restrict set: '[object Object]' +Restrict get: '[object Object]' +Text: 'bcbc ' +==================== +Restrict set: 'aB*Δ' +Restrict get: 'aB*Δ' +Text: 'aBaB*Δ' +==================== +Restrict set: 'aa' +Restrict get: 'aa' +Text: 'aa' +==================== +Restrict set: 'a-z' +Restrict get: 'a-z' +Text: 'abcabc' +==================== +Restrict set: 'A-Z' +Restrict get: 'A-Z' +Text: 'ABCABC' +==================== +Restrict set: 'a-bA' +Restrict get: 'a-bA' +Text: 'abAb' +==================== +Restrict set: 'a-' +Restrict get: 'a-' +Text: 'aa' +==================== +Restrict set: '-b' +Restrict get: '-b' +Text: 'abCABC012^\-* &' +==================== +Restrict set: 'b-a' +Restrict get: 'b-a' +Text: 'bb' +==================== +Restrict set: 'A-z' +Restrict get: 'A-z' +Text: 'abcABC^\' +==================== +Restrict set: '-' +Restrict get: '-' +Text: '' +==================== +Restrict set: '--' +Restrict get: '--' +Text: '' +==================== +Restrict set: '---' +Restrict get: '---' +Text: '' +==================== +Restrict set: '----' +Restrict get: '----' +Text: '' +==================== +Restrict set: '-----' +Restrict get: '-----' +Text: '' +==================== +Restrict set: '-----b' +Restrict get: '-----b' +Text: 'abCABC012^\-* &' +==================== +Restrict set: 'b-----' +Restrict get: 'b-----' +Text: 'bb' +==================== +Restrict set: 'a-b-c' +Restrict get: 'a-b-c' +Text: 'abcABC012^\-* &' +==================== +Restrict set: 'a-b-A' +Restrict get: 'a-b-A' +Text: 'abAb012-* &' +==================== +Restrict set: 'a-a-b' +Restrict get: 'a-a-b' +Text: 'abCABC012^\-* &' +==================== +Restrict set: '\\-\^' +Restrict get: '\\-\^' +Text: '^\' +==================== +Restrict set: '\^-\\' +Restrict get: '\^-\\' +Text: '^' +==================== +Restrict set: '^' +Restrict get: '^' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: '^^' +Restrict get: '^^' +Text: 'abcABC012^\-* &ąδłĄΔŁß' +==================== +Restrict set: '\^a' +Restrict get: '\^a' +Text: 'aa^' +==================== +Restrict set: '^\^' +Restrict get: '^\^' +Text: 'abcABC012\-* &ąδłĄΔŁß' +==================== +Restrict set: '^aą' +Restrict get: '^aą' +Text: 'AbcABC012^\-* &δłĄΔŁß' +==================== +Restrict set: 'a^b^c' +Restrict get: 'a^b^c' +Text: 'acac' +==================== +Restrict set: 'a^b^c^A^B' +Restrict get: 'a^b^c^A^B' +Text: 'aBcaBc' +==================== +Restrict set: 'a-zA-Z^bC' +Restrict get: 'a-zA-Z^bC' +Text: 'aBcABc' +==================== +Restrict set: 'a-zA-Z^' +Restrict get: 'a-zA-Z^' +Text: 'abcABC' +==================== +Restrict set: '\-' +Restrict get: '\-' +Text: '-' +==================== +Restrict set: 'a\-z' +Restrict get: 'a\-z' +Text: 'aa-' +==================== +Restrict set: '\\' +Restrict get: '\\' +Text: '\' +==================== +Restrict set: '\^' +Restrict get: '\^' +Text: '^' +==================== +Restrict set: '\ab' +Restrict get: '\ab' +Text: 'abab' +==================== +Restrict set: 'a\' +Restrict get: 'a\' +Text: 'aa' +==================== +Restrict set: ' -~' +Restrict get: ' -~' +Text: 'abcABC012^\-* &' +==================== +Restrict set: 'α-ω' +Restrict get: 'α-ω' +Text: 'δ' +==================== +No more restricts diff --git a/tests/tests/swfs/avm2/edittext_restrict/test.swf b/tests/tests/swfs/avm2/edittext_restrict/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..9f5437832513729caf5c0a4c5a39c7ecb652fda1 GIT binary patch literal 1612 zcmV-S2DAA?S5qlx2><|i0fkk&bKA%n-(3J)k`_hkBvTS4pJ-dQ;>&_B$%;hFvS`ur z^CX{TpKKo=w*(d>&J@7`Ks{U}X;Ne+>Cz;XtMpf1l_r@IkIMTJEVcGlKUFY3y+tj%4E_yaJ04 zalT!**JztgOW3Dzb}hp_yLORozJs$Ay-%$chsk)-QB&NXJyon z!w3vL<-~W=8rmf9-@ktyl|U7OB`4neX%WT*p}#)3_OD+6^@r$l;kf8`6aNOiuL;-$ z${^qJeH@YB{MvuMx$~7AsA5?-&Re&9I>Vg^v`ZLfN9fWv-wy3Gz7m?N@VlRU`zyk^ z#MQS_NqsGIwNWBmC2B)zs2oIZF)*s6s;Uf2Rs2m21$!gZ2;K@9samj?US4S|r$OrP|#H1c%tQ#wI;G~)s<`&+1C*}AZmLsNHKp_VY4 zEmtu+-5#iqyCTeWeY0h@b;WVv)D^?hdQR-IIBr>Uf$W; z9(^N@pF(^`=w<7$lK?*f`ibedq9bg`$Z@m&rUaH0@SBz{Mmmtxvy;4M0#MgB4`6b;a}oUYNN3Kc2YOvu#N3)N80MI!(7Vwr!>NE%-#vx)e+f%)oqM z_43Kr$91bAGMcrYE$uF53%T5Kw$U@&uGyIwl&zaix6O}>yO5`PuWOkq%G`kpd)Yo$tE*Cp|T1ou0)U+e~#+>ubfS(@f z>xUf=`Nar3Hk3kWP~2p_-n8njRS!N8)4%=dEz#~uUCWV{3MvPD!AX+L zCX34BNfLfCg;O~7X=*#QlX{x^EV)NUFi}D@9En~SiH*)vB2%JJ5~5h8QikFjC3#8; zlq^zmlaggheniO%l~*abMe!OXw<+16xJ1b&C1px-6hENk;S8qa8O5K|_)AKvl+-D~ zRMu!*r*T2!hJp}*D`_3!iP5`1y@MuR07p>x6@L8%tO~3etS@14SdAur-GaA?=Vl{e zghMkMXcjKD&<0Wv#*-W95|%KLH_*ojONkO9SROAS2}2w#tTf?6T()4mb9&Z)Nz?`wa=JnZcNH9x^4-cumh5|4VHRWAU! zbphY-cB>=C2rxY6J@?7#s4;59`$l4GjNI^EK%s^lo{k~@a9JHV_rg_S1f^PSeKl9!K>2p6|>P%!pRx*Jj zTkYo{tr3B$k|E`)X(OGhUN$c0s#lCFx$0HpYOXqK%m&*_bSZdRb6^n#2a)l!U*86d K*na>4zQtR|dloPN literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm2/edittext_restrict/test.toml b/tests/tests/swfs/avm2/edittext_restrict/test.toml new file mode 100644 index 000000000000..dbee897f5863 --- /dev/null +++ b/tests/tests/swfs/avm2/edittext_restrict/test.toml @@ -0,0 +1 @@ +num_frames = 1 From f5c4b1b50dd8476c1fd65c160563a21693815e4d Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Thu, 11 Jan 2024 13:22:08 +0100 Subject: [PATCH 4/5] tests: Add AutomatedEvent::SetClipboardText Currently in tests (input.json) it is possible to trigger Ctrl-V using: { "type": "TextControl", "code": "Paste" }, But there is no way of populating the clipboard. This patch adds AutomatedEvent::SetClipboardText, so the clipboard may be populated before pasting: { "type": "SetClipboardText", "text": "" }, { "type": "TextControl", "code": "Paste" }, --- tests/framework/src/backends/ui.rs | 13 ++++++++++--- tests/framework/src/runner.rs | 11 ++++++++++- tests/input-format/src/format.rs | 3 +++ tests/input-format/src/injector.rs | 3 ++- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/tests/framework/src/backends/ui.rs b/tests/framework/src/backends/ui.rs index 19909f8ae621..9232c759d87a 100644 --- a/tests/framework/src/backends/ui.rs +++ b/tests/framework/src/backends/ui.rs @@ -77,13 +77,18 @@ impl FileDialogResult for TestFileDialogResult { /// otherwise a user cancellation will be simulated /// * Attempting to display a file save dialog with a file name hint of "debug-success.txt" will simulate successfully selecting a destination /// otherwise a user cancellation will be simulated +/// * Simulated in-memory clipboard pub struct TestUiBackend { fonts: Vec, + clipboard: String, } impl TestUiBackend { pub fn new(fonts: Vec) -> Self { - Self { fonts } + Self { + fonts, + clipboard: "".to_string(), + } } } @@ -97,10 +102,12 @@ impl UiBackend for TestUiBackend { fn set_mouse_cursor(&mut self, _cursor: MouseCursor) {} fn clipboard_content(&mut self) -> String { - "".to_string() + self.clipboard.clone() } - fn set_clipboard_content(&mut self, _content: String) {} + fn set_clipboard_content(&mut self, content: String) { + self.clipboard = content; + } fn set_fullscreen(&mut self, _is_full: bool) -> Result<(), FullscreenError> { Ok(()) diff --git a/tests/framework/src/runner.rs b/tests/framework/src/runner.rs index e9bc81a8fe73..58572047ee37 100644 --- a/tests/framework/src/runner.rs +++ b/tests/framework/src/runner.rs @@ -160,6 +160,15 @@ pub fn run_swf( } injector.next(|evt, _btns_down| { + if let AutomatedEvent::SetClipboardText { text } = evt { + player + .lock() + .unwrap() + .ui_mut() + .set_clipboard_content(text.to_owned()); + return; + } + player.lock().unwrap().handle_event(match evt { AutomatedEvent::MouseDown { pos, btn } => PlayerEvent::MouseDown { x: pos.0, @@ -202,7 +211,7 @@ pub fn run_swf( InputTextControlCode::Delete => RuffleTextControlCode::Delete, }, }, - AutomatedEvent::Wait => unreachable!(), + AutomatedEvent::Wait | AutomatedEvent::SetClipboardText { .. } => unreachable!(), }); }); // Rendering has side-effects (such as processing 'DisplayObject.scrollRect' updates) diff --git a/tests/input-format/src/format.rs b/tests/input-format/src/format.rs index 853ac38a5a81..a60ac59bed44 100644 --- a/tests/input-format/src/format.rs +++ b/tests/input-format/src/format.rs @@ -70,4 +70,7 @@ pub enum AutomatedEvent { /// Input a control character code TextControl { code: TextControlCode }, + + /// Populate clipboard with the given text + SetClipboardText { text: String }, } diff --git a/tests/input-format/src/injector.rs b/tests/input-format/src/injector.rs index 700c3105b7af..3486e132a160 100644 --- a/tests/input-format/src/injector.rs +++ b/tests/input-format/src/injector.rs @@ -97,7 +97,8 @@ impl InputInjector { AutomatedEvent::MouseMove { .. } | AutomatedEvent::KeyDown { .. } | AutomatedEvent::TextInput { .. } - | AutomatedEvent::TextControl { .. } => {} + | AutomatedEvent::TextControl { .. } + | AutomatedEvent::SetClipboardText { .. } => {} AutomatedEvent::MouseDown { btn, .. } => { self.buttons |= (*btn).into(); } From 30c992388da3e6ac6df01f09001cc30a6b36540c Mon Sep 17 00:00:00 2001 From: Kamil Jarosz Date: Thu, 11 Jan 2024 13:38:18 +0100 Subject: [PATCH 5/5] core: Support TextField.restrict when pasting --- core/src/display_object/edit_text.rs | 13 ++++++++++++- .../avm1/edittext_restrict_paste/input.json | 17 +++++++++++++++++ .../avm1/edittext_restrict_paste/output.txt | 5 +++++ .../swfs/avm1/edittext_restrict_paste/test.as | 13 +++++++++++++ .../swfs/avm1/edittext_restrict_paste/test.swf | Bin 0 -> 266 bytes .../avm1/edittext_restrict_paste/test.toml | 1 + 6 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 tests/tests/swfs/avm1/edittext_restrict_paste/input.json create mode 100644 tests/tests/swfs/avm1/edittext_restrict_paste/output.txt create mode 100644 tests/tests/swfs/avm1/edittext_restrict_paste/test.as create mode 100644 tests/tests/swfs/avm1/edittext_restrict_paste/test.swf create mode 100644 tests/tests/swfs/avm1/edittext_restrict_paste/test.toml diff --git a/core/src/display_object/edit_text.rs b/core/src/display_object/edit_text.rs index 38eed63f63e0..5fa81ef484c1 100644 --- a/core/src/display_object/edit_text.rs +++ b/core/src/display_object/edit_text.rs @@ -1399,7 +1399,8 @@ impl<'gc> EditText<'gc> { } } TextControlCode::Paste => { - let mut text = context.ui.clipboard_content(); + let text = context.ui.clipboard_content(); + let mut text = self.0.read().restrict.filter_allowed(&text); if text.len() > self.available_chars() && self.available_chars() > 0 { text = text[0..self.available_chars()].to_owned(); @@ -2532,4 +2533,14 @@ impl EditTextRestrict { None } } + + pub fn filter_allowed(&self, text: &str) -> String { + let mut filtered = String::with_capacity(text.len()); + for c in text.chars() { + if let Some(c) = self.to_allowed(c) { + filtered.push(c); + } + } + filtered + } } diff --git a/tests/tests/swfs/avm1/edittext_restrict_paste/input.json b/tests/tests/swfs/avm1/edittext_restrict_paste/input.json new file mode 100644 index 000000000000..139ab21a9f2b --- /dev/null +++ b/tests/tests/swfs/avm1/edittext_restrict_paste/input.json @@ -0,0 +1,17 @@ +[ + { "type": "SetClipboardText", "text": "abc" }, + { "type": "TextControl", "code": "Paste" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "SetClipboardText", "text": "aaa" }, + { "type": "TextControl", "code": "Paste" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "SetClipboardText", "text": "aAbBcCdD" }, + { "type": "TextControl", "code": "Paste" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "SetClipboardText", "text": "aaaBBCC" }, + { "type": "TextControl", "code": "Paste" }, + { "type": "KeyDown", "key_code": 27 }, + { "type": "SetClipboardText", "text": "abcabc" }, + { "type": "TextControl", "code": "Paste" }, + { "type": "KeyDown", "key_code": 27 } +] diff --git a/tests/tests/swfs/avm1/edittext_restrict_paste/output.txt b/tests/tests/swfs/avm1/edittext_restrict_paste/output.txt new file mode 100644 index 000000000000..45d26d15fc5b --- /dev/null +++ b/tests/tests/swfs/avm1/edittext_restrict_paste/output.txt @@ -0,0 +1,5 @@ +Text: 'bc' +Text: '' +Text: 'bbc' +Text: 'bbc' +Text: 'bcb' diff --git a/tests/tests/swfs/avm1/edittext_restrict_paste/test.as b/tests/tests/swfs/avm1/edittext_restrict_paste/test.as new file mode 100644 index 000000000000..caa3a15eb14c --- /dev/null +++ b/tests/tests/swfs/avm1/edittext_restrict_paste/test.as @@ -0,0 +1,13 @@ +var listener = new Object(); +listener.onKeyDown = function() { + if (Key.getCode() == 27) { + trace("Text: '" + text.text + "'"); + text.text = ""; + } +}; +Key.addListener(listener); + +text.restrict = "bc"; +text.maxChars = 3; + +Selection.setFocus(text); diff --git a/tests/tests/swfs/avm1/edittext_restrict_paste/test.swf b/tests/tests/swfs/avm1/edittext_restrict_paste/test.swf new file mode 100644 index 0000000000000000000000000000000000000000..edc0137dd0f3b82bf27a21e39beddf96b6659fd4 GIT binary patch literal 266 zcmV+l0rmbvS5pUy0RRAaoK=oXO2j}AhX2lce4?8Ox)2u*cmxp)WN;84f#?M?Nu!aN zmUN5p2I2u`Bi_j~cnmkODmu(eFaD;!s;|0R_+LQy1ndZmwm>Jgx~@wH0xg_xs(;`F z%<=9W2nZP28l2jZ0NyHWqAInKwQP_~9%OEy>I?ZgQZF^=#+@{=DkN^nI^G}t*+U>J zip!bUNNt*u)JcxVtc~xpM&m|Sw5?P%v@~Zbf7X~<2rzZw^KZBi(MiwtIIRzt`PI^d z-M5^S*)Fm3?N19weaq$W`o4EP=F1-+E-;QDN&X)oUo7n$q~Uycg=00DgEbax5@u|{ QU+*V2(hw1mU;ZjfCp(#ZH2?qr literal 0 HcmV?d00001 diff --git a/tests/tests/swfs/avm1/edittext_restrict_paste/test.toml b/tests/tests/swfs/avm1/edittext_restrict_paste/test.toml new file mode 100644 index 000000000000..dbee897f5863 --- /dev/null +++ b/tests/tests/swfs/avm1/edittext_restrict_paste/test.toml @@ -0,0 +1 @@ +num_frames = 1