New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to be called to foreground and stay in foreground for some time #10

Closed
GoogleCodeExporter opened this Issue Jun 26, 2015 · 7 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Jun 26, 2015

1. Able to go foreground when needed

Could you implement a mechanism to bring Cryptnos to foreground? Such as, when 
a new  instance is run, and/or when a preassigned global hotkey is pressed. I 
used a hotkey to launch Cryptnos but it works only when Cryptnos is not 
running. When Cryptnos is running, the hotkey will do nothing because Cryptnos 
doesn't allow more than one instance (which is good), nor bring the existing 
instance to foreground.

2. Able to stay in foreground for some time while keeping generated password

Some sites/programs do not allow paste action in their password input box, so 
every time I need to: 

generate password with Cryptnos -> open notepad.exe -> paste password -> drag 
notepad window to the edge of screen so that later the browser won't cover the 
password -> switch to browser and type password.

Is it possible to simplify such tedious procedure? For example, a button or 
hotkey to lock Cryptnos on top and keep the generated password (in case "erase 
password when losing focus" is checked)?

Original issue reported on code.google.com by hyptris...@gmail.com on 18 Jan 2013 at 7:44

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Jun 26, 2015

Thanks for your input, hyptristis.

With respect to the first item, one thing I've been considering is trying to 
find a way to turn Cryptnos into an icon in the system tray (usually down where 
the clock is), or at least have the window minimize there. I haven't done a lot 
of research into that, but it's one way to keep it always running but not 
cluttering up the Task Bar.

However, that's not what you asking for. :) I can definitely investigate the 
hotkey idea. I'm not sure if you can assign a "global" hotkey from within .NET; 
it might be possible in some of the Windows-specific assemblies 
(Microsoft.Win32), but it probably wouldn't be cross-platform. That could be a 
problem with respect to the effort to increase support under Mono. That said, 
if I can find a way to implement it, the user should be able to set their own 
choice of hotkey combination; that should avoid potential collisions with other 
apps that might try to use the same hotkey.

And I would be remiss without humbly suggesting that the good old Alt+Tab 
combination to view running apps is still an option.... :D

As for the second item, there is already an option to keep Cryptnos on top of 
other windows. Disable "Daily Use Mode" if you have it turned on, then click 
Advanced. Check the "Keep Cryptnos on top of other windows" checkbox and click 
OK. Cryptnos will now float on top of your other windows, making it easier to 
retype the password in the situation you describe.

Here's the trick, however: you cannot use the "Clear passwords when losing 
focus" option at the same time, at least in this specific use case. As soon as 
Cryptnos will lose focus, the password boxes will be cleared. It's a trade-off, 
and I can't see a way around that if pasting from the clipboard is not an 
option. So only you can decide which function is of greater importance to you. 
One workaround is that once you are done retyping your password, you can always 
minimize the Cryptnos window to hide it from view; the "stay on top" 
functionality only works when the Cryptnos window is visible. This will hide 
the window and the generate password from view of passers-by when you no longer 
need it.

As for making the "always on top" feature a hotkey to be toggled at will... 
that's possible. However, if it were implemented, it should also disable the 
"Clear passwords when losing focus" option, at least temporarily. Both settings 
should revert to the values in the Settings dialog once Cryptnos closes. I'll 
look into that.

Original comment by jeff.darlington@gmail.com on 28 Jan 2013 at 4:33

  • Added labels: Component-UI, Priority-Low, Type-Enhancement
  • Removed labels: Priority-Medium, Type-Defect
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Jun 26, 2015

Forgot to claim ownership of the ticket... oops...

Original comment by jeff.darlington@gmail.com on 28 Jan 2013 at 4:37

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Jun 26, 2015

Thank you for your reply, Jeff.

1. Able to go foreground when needed

Some additional info: I use Hoekey (http://www.bcheck.net/apps/hoe.htm) to 
launch programs via global hotkeys. Recent tests shows that the "failed to go 
foreground when an instance is already running" scenario is hard to recreate. 
In other words, the Cryptnos + Hoekey combo is quite handy in most of the time. 
I'll let you know if I find out how to recreate the problem. 

2. Able to stay in foreground for some time while keeping generated password

Yeah, adding a button/hotkey to the daily use interface + reverting to normal 
settings upon closing would be nice. Personally I'd suggest the following 
implementation: split the long "generate" button into two shorter ones, one for 
normal (pastable) passwords, and one for non-pastable passwords. Upon pressing, 
the latter button would generate password, keep it visible regardless focus, 
and set the window on top, for a predefined period of time. After that, 
Cryptnos automatically clears the password and cancel the "on top" property. 
One click and done!

PS: is it possible to show password in monospaced font (I guess most OS' have 
their default monospace font)? In this way, 0/O and I/l can be better 
distinguished.

Original comment by hyptris...@gmail.com on 29 Jan 2013 at 2:09

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Jun 26, 2015

I'm not sure I like the split button idea; I try to keep the UI as simple as 
possible, and I'm not sure how many users will actually use that functionality. 
A hotkey and/or another checkbox to turn the feature on temporarily might make 
more sense, I'd think. I'll have to give it a bit more thought.

Showing the generated password in monospace has already been implemented in 
version 1.3.3. I'm still working on Issue 8, however, which is the current 
hold-up on that release. (I was hoping for more feedback from that issue's 
original reporter as I've been having trouble recreating and debugging that 
issue myself.)

Original comment by jeff.darlington@gmail.com on 29 Jan 2013 at 2:42

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Jun 26, 2015

OK, I know it's been a while, but here's an update on this issue.

I've done a good bit of research into the two main aspects of this request. 
First, regarding the global hot key: I have found there are methods to register 
a global hot key in Windows but, as I feared, they are very Windows specific 
and actually dip into unmanaged code outside of .NET. This isn't necessarily a 
problem; Cryptnos already uses a similar unmanaged reference to enforce that 
there is only one running instance of the application (as having more than one 
instance might lead to data corruption). (This too is Windows-specific, so 
we'll have to look at other solutions if we improve support under Mono and 
officially support running under other OSes.)

That said, the solutions I've tried haven't exactly worked. I can trace through 
the code and watch everything seem to work as expected (i.e. all the right code 
gets called in all the right places, and the app behaves as expected while the 
debugger is running), but whenever I run things outside the debugger in a "real 
world" test, it never seems to bring Cryptnos to the front. I will likely have 
to table this part of the request for now or potentially abandon it completely. 
I'm not comfortable with some of the changes I had to make to implement 
functionality that didn't work in the first place. If your third-party app 
solution is working for you again, that might be a better solution anyhow.

As for assigning an in-app hot key to toggle the "stay on top" functionality, 
that has worked much better. With Cryptnos open and having focus, you can now 
use Ctrl + T ("Control-Top") to turn on the "stay on top" mode without going 
into the Settings dialog. As I suggested above, this also temporarily disables 
the "clear password on focus loss" setting (if active) so you can type in 
another window while still seeing the password in the Cryptnos window. 
Switching back to Cryptnos and pressing Ctrl + T again restores the settings 
back to the way they were.

While implementing this, I took the liberty to add a few more in-app hot keys 
which may also be useful:

* Ctrl + C anywhere in the main window copies the generated password to the 
system clipboard (regardless of the automatic setting). There really isn't 
anything else in this window worth copying, so this makes sense.
* Ctrl + D toggles the "Daily Mode" checkbox, shrinking or expanding the main 
window as appropriate.
* Ctrl + L toggles the "Lock Parameters" checkbox. If Cryptnos is currently in 
"Daily Mode" when this is used, "Daily Mode" is also disabled and the window 
expanded to its full size.
* Ctrl + R toggles the "Remember Parameters" checkbox, but only if "Lock 
Parameters" is unchecked.
* Ctrl + S in the main window launches the Settings dialog.
* F1 in any of the Cryptnos windows and dialogs now launches the default 
browser and displays the HTML help.

I'm now flagging this as part of the 1.3.3 release. I still haven't heard back 
from the original reporter of Issue 8, so I think I'll go ahead and push out 
that fix as-is as see if anyone else reports a similar problem. I can't give a 
precise ETA, but hopefully I can get this out sometime in the next few days.

Original comment by jeff.darlington@gmail.com on 13 Mar 2013 at 3:28

  • Changed state: Started
  • Added labels: Milestone-1.3.3
@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Jun 26, 2015

This issue was updated by revision r62.


Implemented Issue 10, or at least part of it. Added internal hot keys for a 
number of settings, including the specifically requested "keep on top" feature. 
A number of other hot keys were also added; see the help file or Form1.cs 
comments for the full list.

Main form window now remembers its location and attempts to restore that 
location when the app restarts.

Unchecking "Remember Parameters" when parameters are already saved now asks the 
user for confirmation before clearing the site list.

Updated the HTML help with recent changes.

Changed e-mail address and URL in the header comment of all the .CS files to 
reference the "cryptnos.com" domain rather than the old values.

Original comment by jeff.darlington@gmail.com on 13 Mar 2013 at 6:53

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Jun 26, 2015

Original comment by jeff.darlington@gmail.com on 2 Aug 2013 at 8:29

  • Changed state: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment