tiuub / KeeOtp2

KeeOtp2 is a plugin for KeePass. It provides a form to display one time passwords and is fully compatible with the built-in OTP function.
MIT License
126 stars 11 forks source link

An error indicating `hotkey is registered' when starting keepass #42

Closed taroxd closed 2 years ago

taroxd commented 2 years ago

Error Detail (The Chinese means `hotkey is registered'):

[Window Title] KeePass

[Content] The following plugin is incompatible with the current KeePass version: C:\Users\taroxd\AppData\Local\KeePass\PluginCache\nltA12hROdxB9UF3AoZV\KeeOtp2.dll

Have a look at the plugin's website for an appropriate version.

[Expanded Information] 热键已注册。 (异常来自 HRESULT:0x80070581) NHotkey 在 NHotkey.Hotkey.Register(IntPtr hwnd, String name) 在 NHotkey.HotkeyManagerBase.AddOrReplace(String name, UInt32 virtualKey, HotkeyFlags flags, EventHandler1 handler) 在 KeeOtp2.KeeOtp2Config.registerHotKey() 在 KeeOtp2.KeeOtp2Config.loadConfig() 在 KeeOtp2.KeeOtp2Ext.Initialize(IPluginHost host) 在 KeePass.Plugins.PluginManager.LoadPlugins(List1 lFiles, String strTypeName, String strDisplayFilePath, Boolean bSkipCacheFiles) Void Register(IntPtr, System.String)

Inner: 热键已注册。 (异常来自 HRESULT:0x80070581)

OS: Windows 11 (Inside a Hyper-V virtual machine) This error occurs even if I disabled the global/local hotkey in the configuration. I am not relying on hotkeys, so maybe properly catch this exception can resolve the problem?

By the way, in makeplgx.bat, the first line contains @@ -1,117 +0,0 @@ which seems to be redundant.

creckord commented 2 years ago

Same here. Any way to figure out which hotkey is already registered to which function?

creckord commented 2 years ago

Figured it out. It's the global hotkey. It was already in use by another application.

I wasn't able to disable it through "Use global hotkey", because that disabled the local hotkey as well, so I reassigned it to something I'm unlikely to hit by accident.

taroxd commented 2 years ago

Figured it out. It's the global hotkey. It was already in use by another application.

I wasn't able to disable it through "Use global hotkey", because that disabled the local hotkey as well, so I reassigned it to something I'm unlikely to hit by accident.

Thanks. I reassigned my global hotkey to another one and then disabled it, and now the annoying error disappeared. It is quite confusing that even if I disable the hotkey, the plugin still try to register it.

tiuub commented 2 years ago

Hey, fixed this in the newest version 1.5.9. The plugin won't register a hotkey anymore if the global hotkey is deactivated. It also displays a more recognizeable error message, when the hotkey already is in use.

Kind regards tiuub