Skip to content
This repository was archived by the owner on Jun 20, 2023. It is now read-only.

Commit bb22a37

Browse files
author
skver0
committed
Fixed capslock indicator from pool request
yes
1 parent ef442f7 commit bb22a37

File tree

6 files changed

+53
-57
lines changed

6 files changed

+53
-57
lines changed

Main.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public Main()
9393
bool helpdialog = false;
9494
PowerStatus battery = SystemInformation.PowerStatus;
9595
Help help = new Help();
96+
publicbool publicbool = new publicbool();
9697
string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
9798

9899
private void Main_Load(object sender, EventArgs e)
@@ -266,14 +267,8 @@ private void t1_Tick(object sender, EventArgs e)
266267

267268
if (IsKeyPushedDown(Keys.CapsLock))
268269
{
269-
if (IsKeyLocked(Keys.CapsLock))
270+
if (!publicbool.visible)
270271
{
271-
// nt1.ShowBalloonTip(5, "x1", "capslock enabled", ToolTipIcon.None);
272-
caps.Show();
273-
}
274-
else
275-
{
276-
//nt1.ShowBalloonTip(5, "x1", "capslock disabled", ToolTipIcon.None);
277272
caps.Show();
278273
}
279274
}

caps.Designer.cs

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

caps.cs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@ public caps()
1717
InitializeComponent();
1818
}
1919

20-
private void label1_Click(object sender, EventArgs e)
21-
{
22-
23-
}
24-
20+
publicbool publicbool = new publicbool();
2521
private void caps_Load(object sender, EventArgs e)
26-
{
27-
this.Opacity = 1;
22+
{
23+
publicbool.visible = true;
24+
Opacity = 1;
2825
if (IsKeyLocked(Keys.CapsLock))
2926
{
30-
label1.Text = "A";
27+
Opacity = 1;
28+
capsindicator.Text = "caps on";
3129
}
3230
else
3331
{
34-
label1.Text = "a";
32+
Opacity = 1;
33+
capsindicator.Text = "caps off";
3534
}
36-
timer1.Start();
37-
timer1.Interval = 1;
35+
t1.Start();
36+
t1.Interval = 1;
3837
}
3938

4039
private void timer1_Tick(object sender, EventArgs e)
4140
{
42-
if (this.Opacity > 0)
41+
if (Opacity > 0)
4342
{
44-
this.Opacity -= 0.01;
43+
Opacity -= 0.01;
4544
}
4645
else {
47-
this.Close();
48-
timer1.Stop();
46+
publicbool.visible = false;
47+
Close();
48+
t1.Stop();
4949
}
5050
}
5151
}

caps.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
120+
<metadata name="t1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121121
<value>17, 17</value>
122122
</metadata>
123123
</root>

publicbool.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace x1
8+
{
9+
public class publicbool
10+
{
11+
public bool visible = false;
12+
}
13+
}

x1.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
</Compile>
7070
<Compile Include="Program.cs" />
7171
<Compile Include="Properties\AssemblyInfo.cs" />
72+
<Compile Include="publicbool.cs" />
7273
<EmbeddedResource Include="caps.resx">
7374
<DependentUpon>caps.cs</DependentUpon>
7475
</EmbeddedResource>

0 commit comments

Comments
 (0)