… | |
… | |
1084 | ->click (1, 100, "mouse") |
1084 | ->click (1, 100, "mouse") |
1085 | ->type ("some text") |
1085 | ->type ("some text") |
1086 | ->key ("{Enter}") |
1086 | ->key ("{Enter}") |
1087 | ->perform; |
1087 | ->perform; |
1088 | |
1088 | |
1089 | When you specify the event source expliticly it will switch the current |
1089 | When you specify the event source explicitly it will switch the current |
1090 | "focus" for this class of device (all keyboards are in one class, all |
1090 | "focus" for this class of device (all keyboards are in one class, all |
1091 | pointer-like devices such as mice/fingers/pens are in one class), so you |
1091 | pointer-like devices such as mice/fingers/pens are in one class), so you |
1092 | don't have to specify the source for subsequent actions. |
1092 | don't have to specify the source for subsequent actions. |
1093 | |
1093 | |
1094 | When you use the sources C<keyboard>, C<mouse>, C<touch1>..C<touch3>, |
1094 | When you use the sources C<keyboard>, C<mouse>, C<touch1>..C<touch3>, |
… | |
… | |
1118 | bless \%kv, $class |
1118 | bless \%kv, $class |
1119 | } |
1119 | } |
1120 | |
1120 | |
1121 | =item $al = $al->source ($id, $type, key => value...) |
1121 | =item $al = $al->source ($id, $type, key => value...) |
1122 | |
1122 | |
1123 | The first time you call this with a givne ID, this defines the event |
1123 | The first time you call this with a given ID, this defines the event |
1124 | source using the extra parameters. Subsequent calls merely switch the |
1124 | source using the extra parameters. Subsequent calls merely switch the |
1125 | current source for its event class. |
1125 | current source for its event class. |
1126 | |
1126 | |
1127 | It's not an error to define built-in sources (such as C<keyboard> or |
1127 | It's not an error to define built-in sources (such as C<keyboard> or |
1128 | C<touch1>) differently then the defaults. |
1128 | C<touch1>) differently then the defaults. |
1129 | |
1129 | |
1130 | Example: define a new touch device called C<fatfinger>. |
1130 | Example: define a new touch device called C<fatfinger>. |
1131 | |
1131 | |
1132 | $al->source (fatfinger => "pointer", pointerType => "touch"); |
1132 | $al->source (fatfinger => "pointer", pointerType => "touch"); |
1133 | |
1133 | |
1134 | Example: switchdefine a new touch device called C<fatfinger>. |
1134 | Example: define a new touch device called C<fatfinger>. |
1135 | |
1135 | |
1136 | $al->source (fatfinger => "pointer", pointerType => "touch"); |
1136 | $al->source (fatfinger => "pointer", pointerType => "touch"); |
|
|
1137 | |
|
|
1138 | Example: switch default keyboard source to C<kbd1>, assuming it is of C<key> class. |
|
|
1139 | |
|
|
1140 | $al->source ("kbd1"); |
1137 | |
1141 | |
1138 | =cut |
1142 | =cut |
1139 | |
1143 | |
1140 | sub _default_source($) { |
1144 | sub _default_source($) { |
1141 | my ($source) = @_; |
1145 | my ($source) = @_; |