Commit 87c4250 1 parent f63d8e8 commit 87c4250 Copy full SHA for 87c4250
File tree 1 file changed +21
-14
lines changed
src/screens/home/displays
1 file changed +21
-14
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import { motion } from 'framer-motion';
21
21
import {
22
22
GamepadEvent ,
23
23
KeyEvent ,
24
+ KeyModifiers ,
24
25
LegacyControllerEvent ,
25
26
LegacyKeyEvent ,
26
27
MouseEvent ,
@@ -194,20 +195,7 @@ function KeyEventView({ event }: { event?: KeyEvent | LegacyKeyEvent }) {
194
195
< div className = "flex flex-col items-center gap-1" >
195
196
< ObjectInspectorTable objects = { [ event ] } names = { keyEventNames } />
196
197
< Divider />
197
- < div className = "flex flex-row gap-2" >
198
- < ModifierView down = { event . shiftKey } >
199
- < IconArrowBigUp />
200
- </ ModifierView >
201
- < ModifierView down = { event . ctrlKey } >
202
- < IconChevronUp />
203
- </ ModifierView >
204
- < ModifierView down = { event . altKey } >
205
- < IconAlt />
206
- </ ModifierView >
207
- < ModifierView down = { event . metaKey } >
208
- < IconCommand />
209
- </ ModifierView >
210
- </ div >
198
+ < KeyModifiersView modifiers = { event . modifiers } />
211
199
< Divider />
212
200
</ div >
213
201
)
@@ -216,6 +204,25 @@ function KeyEventView({ event }: { event?: KeyEvent | LegacyKeyEvent }) {
216
204
) ;
217
205
}
218
206
207
+ function KeyModifiersView ( { modifiers } : { modifiers : KeyModifiers } ) {
208
+ return (
209
+ < div className = "flex flex-row gap-2" >
210
+ < ModifierView down = { modifiers . shift } >
211
+ < IconArrowBigUp />
212
+ </ ModifierView >
213
+ < ModifierView down = { modifiers . ctrl } >
214
+ < IconChevronUp />
215
+ </ ModifierView >
216
+ < ModifierView down = { modifiers . alt } >
217
+ < IconAlt />
218
+ </ ModifierView >
219
+ < ModifierView down = { modifiers . meta } >
220
+ < IconCommand />
221
+ </ ModifierView >
222
+ </ div >
223
+ ) ;
224
+ }
225
+
219
226
function ModifierView ( {
220
227
down,
221
228
children,
You can’t perform that action at this time.
0 commit comments