File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 133
133
case SYM_KEY :
134
134
//VAL_EVENT_TYPE(value) != EVT_KEY && VAL_EVENT_TYPE(value) != EVT_KEY_UP)
135
135
VAL_EVENT_MODEL (value ) = EVM_GUI ;
136
+ if (!VAL_EVENT_TYPE (value )) VAL_EVENT_TYPE (value ) = EVT_KEY ;
136
137
if (IS_CHAR (val )) {
137
138
VAL_EVENT_DATA (value ) = VAL_CHAR (val );
138
139
CLR_FLAG (VAL_EVENT_FLAGS (value ), EVF_HAS_XY );
Original file line number Diff line number Diff line change @@ -29,6 +29,30 @@ Rebol [
29
29
event? e: try [make event! [offset: 1x2 ]]
30
30
e/offset = 1x2
31
31
]
32
+ --test-- "key event"
33
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/1526
34
+ --assert all [
35
+ event? e: try [make event! [type: 'key key: #"A" ]]
36
+ e/key == #"A"
37
+ none? e/offset
38
+ ]
39
+ --assert all [
40
+ event? e: try [make event! [key: #"B" ]]
41
+ e/key == #"B"
42
+ e/type = 'key ; added automaticaly if no type is specified
43
+ ]
44
+ --assert all [
45
+ event? e: try [make event! [type: 'custom key: #"C" ]]
46
+ none? e/key ; only key and key-up types will provide it
47
+ e/type = 'custom
48
+ e/code = 67
49
+ ]
50
+ --assert all [
51
+ event? e: try [make event! [type: 'key-up key: #"C" ]]
52
+ e/key == #"C"
53
+ e/type = 'key-up
54
+ e/code = 67
55
+ ]
32
56
33
57
===end-group===
34
58
You can’t perform that action at this time.
0 commit comments