jparnell8839 / AlwaysOnTop

Make a Windows application always run on top
GNU General Public License v3.0
205 stars 40 forks source link

Keyboard not working while using it. #15

Open Ramundir opened 7 years ago

Ramundir commented 7 years ago

I can't type any word any where even capslock can't be on, after i used it for topping an app Windows 10 64bit, AMD A8

fhucko commented 7 years ago

I confirm that. Keyboard works like 10% of the time. Exiting the AlwaysOnTop application resolves the issue.

ThePerry-2015 commented 7 years ago

Same here, the main reason I wanted to test this app was to be able to put my Putty windows on top, but I'm not able to type into any Putty windows when your application is running. :( Intel Core i5-2500K CPU, 16 GB RAM Windows 10 Pro 64-bit (Build#: 15063.14), Logitech MK700 (Unifying) keyboard controlled by SetPoint Control Center 6.67.82, Driver version: 5.90.41 Other applications I'm running in the background: 7+ Taskbar Tweaker, used to alter the taskbars on my 4-head setup to remove the notification part from all but the main monitor. 8gadgetpack to re-enable the Gadgets/Sidebar that Microsoft decided we didn't need anymore.

rjdamore commented 7 years ago

I can confirm this is the case for me as well. Surface pro 4. Using TypeCover. latest Windows release as of this date 4-19-2017

geekloper commented 7 years ago

Keyboard works when i exit the application and window which i selected stays always on top.

weissel commented 7 years ago

Confirmed. Using vim (8.0, included patches 1-568, compiled Apr 20, 2017, 64 bit), Windows 10 Pro (64 bit, Version 1703, OS Build 15063.296, vim on Windows runs as gvim, i.e. with GUI, unless started in a terminal), AlwaysOnTop (Version 0.6.1, Build 170118.2106) I observe the following behaviour:

  1. Start Vim, start AlwaysOnTop (Order does not seem to matter)
  2. check that your keyboard is working
  3. use AlwaysOnTop on the vim window
  4. note that the keyboard does not seem to react any more:
    • Keyboard presses seem to not be registered by any program
    • Num lock, Caps lock do not switch the status, at least none of the keyboard mode lights for them come on.
    • Keyboard internal functions (like an F-mode (gaming mode) or key backlight brightness controls still work fine.
    • Ctrl-Alt-Del works(!)
  5. Switch off AlwaysOnTop of the vim Window (or stop AlwaysOnTop)
  6. The keyboard works again.

If you exit AlwaysOnTop while a windows is in AlwaysOnTop mode, it'll sometimes (not always) stay "always on top".

kofifus commented 7 years ago

Any news on this ?

fidesachates commented 7 years ago

Confirmed. Surface Book.

wnipper commented 7 years ago

+1. Windows 10. I'm busy with the 4th this weekend, but based on jparnell's comment in another issue report about this, I'll run a diff between 0.5.1 and 0.6.1 next week and see if I can figure out the problem.

Temporary workaround is:

This releases the keyboard and keeps the selected window on top. There will be a residual context menu on the screen, but AlwaysOnTop closes the first time you hit "Exit". There's no need to hit it again and it'll disappear when you click anywhere.

lankymart commented 7 years ago

Can confirm this happens on Windows 10 1703 (64 Bit), was fine for the first hour or so but it seems like some Keyboard Hooking is too aggressive (likely for the HotKey registration) and renders the keyboard (on-screen and physical) useless until you close the application.

wnipper commented 7 years ago

You're correct, @lankymart. The problem is in AlwaysOnTop.cs, line 170 thru 173. The hook is being created with no keys set if there are no declared hotkeys. That's causing the hook listener to swallow every keystroke. Commenting those lines out doesn't seem to affect anything, though I haven't run hotkeys.

There are two possible workarounds

  1. if you guys have VS, use nuget to install octokit, comment out those lines, build and publish to install the latest version. Again, I'm not sure if this will break setting new hotkeys. I don't use them and it hasn't been tested (yet)

  2. in your current version, go to Settings -> Use Hotkey. Set it to true. Don't bother trying to set a hotkey yet; the app is still swallowing inputs. When AlwaysOnTop restarts, an error will be thrown because it expects a hotkey to be set. Don't worry about it--it's not a hard crash. The app will now work as intended.

@jparnell8839 if you want to give me contributor permissions I'll test this fix more thoroughly and create a pull request.

lankymart commented 7 years ago

@wnipper Awesome find! Hadn't looked at the code myself but this certainly seems to be the cause.

wnipper commented 7 years ago

This was driving me nuts on my day off yesterday so I took an hour this morning to really dig into it. The actual problem is in the globalKeyboardHook.cs class. Not sure who contributed this, but it's broken.

Long story short, hookProc was getting garbage collected and an error was being swallowed. Make hookProc into a class delegate that gets instantiated in the constructor and everything works as expected.

I've fixed this, cleaned up some of the code, and corrected a problem where an error was thrown if Use Hotkeys was checked but no hotkey was set. It could use quite a bit more cleanup but I'm not gonna bother if I can't commit the changes.

@jparnell8839, again, dude...you wanna hook me up with push? Otherwise I'm going to assume this repo is dead and start up a new one.

wnipper commented 7 years ago

@lankymart My fork is now functional. There are more changes that need to be made before I feel comfortable creating a PR.

C4DXYZ commented 7 years ago

last update was 6 mos ago? why microsoft people don't just add this simple thing.. WTF!

Petschko commented 6 years ago

Hey I have the same Problem! I used this to open an Image as reference with Paint-Tool-SAI.

I was not able to use these Keys: Enter, Alt, Ctrl

I need those to work properly with my program. But I found a Workarround:

  1. Set the Window always to top
  2. Exit the "Always on Top" Application
  3. Work normal with your software, while the Window is still always on top

Edit: I used this on Windows 7 x64

cleebp commented 5 years ago

Still happening on win10/chrome.

wagenaartje commented 3 years ago

Still happening.