Skip to content

Commit f517dc3

Browse files
committed
Auto-Type entry selection: Auto-Submit when clicking password column
1 parent 25a1b16 commit f517dc3

File tree

6 files changed

+48
-10
lines changed

6 files changed

+48
-10
lines changed

src/AlternateAutoType.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,11 @@ private void CellClick(object sender, MouseEventArgs e)
548548
string column = (sender as ListView).Columns[col].Text;
549549
string sequence = string.Empty;
550550
if (column == KeePass.Resources.KPRes.UserName) sequence = "{USERNAME}";
551-
else if (column == KeePass.Resources.KPRes.Password) sequence = "{PASSWORD}";
552-
else if (column == Config.PWColumnHeader) sequence = "{PASSWORD}";
551+
else if (column == KeePass.Resources.KPRes.Password || column == Config.PWColumnHeader)
552+
{
553+
sequence = "{PASSWORD}";
554+
if (Config.SpecialColumnsRespectPWEnter && Config.PWEnter) sequence += "{ENTER}";
555+
}
553556
else return;
554557
AutoTypeCtx ctx = info.Item.Tag as AutoTypeCtx;
555558
if (ctx == null) return;
@@ -591,6 +594,7 @@ private void OptionsFormShown(object sender, Tools.OptionsFormsEventArgs e)
591594
options.cbColumnsRememberSort.Checked = Config.ColumnsRememberSorting;
592595
options.cbDBColumn.Checked = Config.AddDBColumn;
593596
options.cbSpecialColumns.Checked = Config.SpecialColumns;
597+
options.cbSpecialColumnsRespectPWEnter.Checked = Config.SpecialColumnsRespectPWEnter;
594598
options.cbKeepATOpen.Checked = Config.KeepATOpen;
595599
options.cbExcludeExpiredGroups.Checked = Config.ExcludeExpiredGroups;
596600
e.form.Shown += options.OptionsForm_Shown;
@@ -616,6 +620,7 @@ private void OptionsForm_Closed(object sender, Tools.OptionsFormsEventArgs e)
616620
Config.ColumnsRememberSorting = options.cbColumnsRememberSort.Checked;
617621
Config.AddDBColumn = options.cbDBColumn.Checked;
618622
Config.SpecialColumns = options.cbSpecialColumns.Checked;
623+
Config.SpecialColumnsRespectPWEnter = options.cbSpecialColumnsRespectPWEnter.Checked;
619624
Config.KeepATOpen = options.cbKeepATOpen.Checked;
620625
Config.ExcludeExpiredGroups = options.cbExcludeExpiredGroups.Checked;
621626

src/Config.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ public static bool KeepATOpen
9393
Program.Config.CustomConfig.SetBool(m_KeepATOpenConfig, value);
9494
}
9595
}
96+
97+
public static bool SpecialColumnsRespectPWEnter
98+
{
99+
get
100+
{
101+
if (KeePassLib.Native.NativeLib.IsUnix()) return false;
102+
return Program.Config.CustomConfig.GetBool(m_SpecialColumnsRespectPWEnter, true);
103+
}
104+
set
105+
{
106+
if (KeePassLib.Native.NativeLib.IsUnix()) return;
107+
Program.Config.CustomConfig.SetBool(m_SpecialColumnsRespectPWEnter, value);
108+
}
109+
}
110+
96111
public static bool PWEnter
97112
{
98113
get { return Program.Config.CustomConfig.GetBool(m_PWEnterConfig, false); }
@@ -127,6 +142,7 @@ public static bool ExcludeExpiredGroups
127142
private static string c_PWColumnHeader = KeePass.Resources.KPRes.Password + " (AAT)";
128143
private static string m_SpecialColumnsConfig = "AlternateAutoType.SpecialColumns";
129144
private static string m_KeepATOpenConfig = "AlternateAutoType.KeepATOpen";
145+
private static string m_SpecialColumnsRespectPWEnter = "AlternateAutoType.SpecialColumnsRespectPWEnter";
130146
private static string m_ExcludeExpiredGroups = "AlternateAutoType.ExcludeExpiredGroups";
131147

132148
private static void SetKey(string param, Keys value)

src/Options.Designer.cs

Lines changed: 19 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Options.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public Options()
2828
cbDBColumn.Text = PluginTranslate.AddDBColumn;
2929
cbSpecialColumns.Text = PluginTranslate.SpecialColumns;
3030
cbKeepATOpen.Text = PluginTranslate.KeepATOpen;
31+
cbSpecialColumnsRespectPWEnter.Text = KeePass.Resources.KPRes.Password + " = " + PluginTranslate.PasswordEnterHotKey;
3132
cbExcludeExpiredGroups.Text = PluginTranslate.ExcludeExpiredGroups;
3233
cbColumnsRememberSort.Text = PluginTranslate.ColumnsSortRemember;
3334

@@ -74,11 +75,13 @@ private Keys GetHotKey(HotKeyControlEx hkBox)
7475
private void cbSpecialColumns_CheckedChanged(object sender, System.EventArgs e)
7576
{
7677
cbKeepATOpen.Enabled = cbSpecialColumns.Checked;
78+
cbSpecialColumnsRespectPWEnter.Enabled = cbSpecialColumns.Checked;
7779
}
7880

7981
private void Options_Load(object sender, System.EventArgs e)
8082
{
8183
gHotkeys.Enabled = !KeePassLib.Native.NativeLib.IsUnix();
84+
cbSpecialColumns_CheckedChanged(null, null);
8285
}
8386

8487
internal void OptionsForm_Shown(object sender, EventArgs e)

src/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ KeePass types EITHER everything before OR everything after {AAT}.
2727
//
2828
// You can specify all the values or you can use the default the Revision and
2929
// Build Numbers by using the '*' as shown below:
30-
[assembly: AssemblyVersion("1.16")]
31-
[assembly: AssemblyFileVersion("1.16")]
30+
[assembly: AssemblyVersion("1.17")]
31+
[assembly: AssemblyFileVersion("1.17")]
3232
[assembly: Guid("78C152F3-EAF8-4FFC-9BE3-F5DC0CD66E5D")]
3333

version.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
:
2-
AlternateAutoType:1.16
2+
AlternateAutoType:1.17
33
AlternateAutoType!de:5
44
AlternateAutoType!pt:1
55
AlternateAutoType!ru:4

0 commit comments

Comments
 (0)