TODO feature: When Rectangle selection tool is active hold Ctrl+Alt to temporary disable it to be able to draw

This commit is contained in:
Anton Mukhin
2025-07-08 10:49:26 +03:00
parent 6cbc206260
commit 30729aca2f
4 changed files with 25 additions and 1 deletions

View File

@@ -1221,6 +1221,7 @@
Controls.Add(dotPanel);
Controls.Add(menuStrip1);
Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
KeyPreview = true;
MainMenuStrip = menuStrip1;
Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
MinimumSize = new System.Drawing.Size(931, 686);
@@ -1229,6 +1230,8 @@
Text = "McBitFont";
FormClosing += MainForm_FormClosing;
Load += Form1_Load;
KeyDown += MainForm_KeyDown;
KeyUp += MainForm_KeyUp;
((System.ComponentModel.ISupportInitialize)nudX).EndInit();
((System.ComponentModel.ISupportInitialize)nudY).EndInit();
panel1.ResumeLayout(false);

View File

@@ -594,7 +594,7 @@ namespace McBitFont {
// Check for Shift / Ctrl keys for straight lines
if (ModifierKeys.HasFlag(Keys.Shift) && mouseDown) {
j = lastY;
} else if (ModifierKeys.HasFlag(Keys.Control) && mouseDown) {
} else if (ModifierKeys.HasFlag(Keys.Control) && mouseDown && !CAKeyDown) {
i = lastX;
}
lastX = i;
@@ -1715,5 +1715,24 @@ namespace McBitFont {
SetModified();
}
}
static bool CAKeyDown = false;
private void MainForm_KeyDown(object sender, KeyEventArgs e) {
if (CAKeyDown) return;
if (chkRectSelect.Checked && e.Control && e.Alt) {
//MessageBox.Show("Down: Alt!");
chkRectSelect.Checked = false;
CAKeyDown = true;
e.Handled = true;
}
}
private void MainForm_KeyUp(object sender, KeyEventArgs e) {
if (CAKeyDown && !e.Control && !e.Alt) {
chkRectSelect.Checked = true;
CAKeyDown = false;
e.Handled = true;
}
}
}
}

View File

@@ -26,6 +26,7 @@ Some basic hints on the interface:
- Shift + scroll to scroll left and right
- Crtl + scroll to zoom
- Alt + Scroll to change painting brush size
- When Rectangle selection tool is active hold Ctrl+Alt to temporary disable it to be able to draw
Download in the [Releases](https://gitea.mcflyer.ru/McFLY/McBitFont/releases) section!

View File

@@ -3,6 +3,7 @@ Application:
Functionality:
V Show note field in Export comments
V When Rectangle selection tool is active hold Ctrl+Alt to temporary disable it to be able to draw
Bugs: