Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
</button>

<div class="scene-top-actions">
<label class="caps-lock"
[class.displayed]="isCapsLock"
>CapsLock On</label>
<button mat-mini-fab
color="primary"
matTooltip="Undo"
Expand Down
11 changes: 11 additions & 0 deletions src/app/app.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,14 @@ label.cursor-position {
border-radius: 4px;
pointer-events: none;
}

.caps-lock {
padding: 4px;
background-color: #383838;
color: white;
opacity: 0;
margin-right: 24px;
&.displayed {
opacity: 1;
}
}
2 changes: 2 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export class AppComponent implements AfterViewInit {
isLeftPanelOpened = true;
isContextualMenuOpened = false;
isEditingImages = false;
isCapsLock = false;

// Utility functions:
max = Math.max;
Expand All @@ -98,6 +99,7 @@ export class AppComponent implements AfterViewInit {
}

@HostListener('document:keydown', ['$event']) onKeyDown($event: KeyboardEvent) {
this.isCapsLock = $event.getModifierState('CapsLock');
const tag = $event.target instanceof Element ? $event.target.tagName : null;
if (tag !== 'INPUT' && tag !== 'TEXTAREA') {
if ($event.shiftKey && ($event.metaKey || $event.ctrlKey) && $event.key.toLowerCase() === 'z') {
Expand Down