Skip to content

Commit

Permalink
Add Control Mod to Track Group Selection (#132)
Browse files Browse the repository at this point in the history
* add ctrl modifier for track groups

* Check OS for which modifier to use
  • Loading branch information
ALevansSamsung authored Jan 28, 2025
1 parent aa86027 commit fe7f68f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ui/src/frontend/track_group_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ export class TrackGroupPanel extends Panel<Attrs> {
m(`.shell[draggable=true]`,
{
onclick: (e: MouseEvent) => {
if (!(navigator.userAgent.includes('Mac')? e.metaKey : e.ctrlKey)) {
globals.dispatch(
Actions.clearTrackAndGroupSelection({}));
}
globals.dispatch(
Actions.toggleTrackGroupSelection(
{trackGroupId: attrs.trackGroupId}));
Expand Down
2 changes: 1 addition & 1 deletion ui/src/frontend/track_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class TrackShell implements m.ClassComponent<TrackShellAttrs> {
{
class: `${highlightClass} ${dragClass} ${dropClass} ${globals.state.selectedTrackIds.has(attrs.trackState.id)? 'selected': ''}`,
onclick: (e: MouseEvent)=>{
if (!e.ctrlKey) {
if (!(navigator.userAgent.includes('Mac')? e.metaKey : e.ctrlKey)) {
globals.dispatch(
Actions.clearTrackAndGroupSelection({}));
}
Expand Down

0 comments on commit fe7f68f

Please sign in to comment.