mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Added: CTRL+Backspace
This commit is contained in:
parent
64cea5ab9b
commit
a57e010f17
@ -8,6 +8,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
public sealed partial class NetworkChat : Form
|
||||
{
|
||||
Logic.Networking.NikseWebServiceSession _networkSession;
|
||||
private string breakChars = "\".!?,)([]<>:;♪{}-/#*| ¿¡" + Environment.NewLine + "\t";
|
||||
|
||||
protected override bool ShowWithoutActivation
|
||||
{
|
||||
@ -73,6 +74,45 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
e.SuppressKeyPress = true;
|
||||
buttonSendChat_Click(null, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (e.KeyData == (Keys.Control | Keys.A))
|
||||
{
|
||||
textBoxChat.SelectAll();
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
if (e.Modifiers == Keys.Control && e.KeyCode == Keys.Back)
|
||||
{
|
||||
int index = textBoxChat.SelectionStart;
|
||||
if (textBoxChat.SelectionLength == 0)
|
||||
{
|
||||
var s = textBoxChat.Text;
|
||||
int deleteFrom = index - 1;
|
||||
|
||||
if (deleteFrom > 0 && deleteFrom < s.Length)
|
||||
{
|
||||
if (s[deleteFrom] == ' ')
|
||||
deleteFrom--;
|
||||
while (deleteFrom > 0 && !(breakChars).Contains(s.Substring(deleteFrom, 1)))
|
||||
{
|
||||
deleteFrom--;
|
||||
}
|
||||
if (deleteFrom == index - 1)
|
||||
{
|
||||
while (deleteFrom > 0 && (breakChars.Replace(" ", string.Empty)).Contains(s.Substring(deleteFrom - 1, 1)))
|
||||
{
|
||||
deleteFrom--;
|
||||
}
|
||||
}
|
||||
if (s[deleteFrom] == ' ')
|
||||
deleteFrom++;
|
||||
textBoxChat.Text = s.Remove(deleteFrom, index - deleteFrom);
|
||||
textBoxChat.SelectionStart = deleteFrom;
|
||||
}
|
||||
}
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void AddUser(SeNetworkService.SeUser user)
|
||||
|
@ -112,12 +112,12 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="imageListUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<metadata name="imageListUsers.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<data name="imageListUsers.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
@ -125,7 +125,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAAo
|
||||
EgAAAk1TRnQBSQFMAgEBCAEAAdABAAHQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
EgAAAk1TRnQBSQFMAgEBCAEAAdgBAAHYAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
Loading…
Reference in New Issue
Block a user