Skip to content

Commit

Permalink
CUERipper: Allow editing Metadata using F2
Browse files Browse the repository at this point in the history
Editing Track Titles has been possible using F2. Add the same behavior
to the Metadata list. This is an additional possibility using the
keyboard instead of clicking.

- Add `listMetadata_KeyDown` event for key `F2`
- Add `listMetadata_PreviewKeyDown` event for `Enter`
  Hitting Enter after editing will move to the next Metadata item now,
  as in `listTracks`.
- Keys for navigation in CUERipper under Tracks or Meta:
  Moving: Cursor up, Cursor down
  Editing: F2, Enter, Ctrl+Tab, Ctrl+Shift+Tab, Esc
  • Loading branch information
c72578 committed Jun 6, 2023
1 parent 8cb7870 commit 9888027
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CUERipper/frmCUERipper.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions CUERipper/frmCUERipper.cs
Expand Up @@ -1856,6 +1856,28 @@ private void bnComboBoxC2ErrorModeSetting_SelectedValueChanged(object sender, Ev
selectedDriveInfo.drive.DriveC2ErrorMode = (int)bnComboBoxC2ErrorModeSetting.SelectedItem;
}
}

private void listMetadata_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F2)
{
listMetadata.FocusedItem.BeginEdit();
}
}

private void listMetadata_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
if (listMetadata.FocusedItem != null && listMetadata.FocusedItem.Index + 1 < listMetadata.Items.Count)// && e.Label != null)
{
listMetadata.FocusedItem.Selected = false;
listMetadata.FocusedItem = listMetadata.Items[listMetadata.FocusedItem.Index + 1];
listMetadata.FocusedItem.Selected = true;
listMetadata.FocusedItem.BeginEdit();
}
}
}
}

internal class BackgroundWorkerArtworkArgs
Expand Down

0 comments on commit 9888027

Please sign in to comment.