I see some issues in your report. First is you have Avira Antivirus & CCleaner installed which is considered malware by most experienced users on these forums. Mac OS is catlike in that it cleans itself, Mac OS does not benefit from nor does it require any of the following types of third party apps:
· Antivirus Apps
· Cleaning Apps
· Security Apps
· VPN Apps
· Maintenance Apps
What these types of apps do is the exact opposite of what users want. They make Mac OS slow, appear buggy, can damage Mac OS and sometimes create unwanted behaviors just like what you are experiencing! In short, they are really bad news!
So the first order of business for your computer is that you need to locate the developers. uninstall instructions for Avira AV & CCleanerr and please uninstall Avira & CCleaner. Because Avira & CCleaner are pretty nasty they tend to leave parts behind after being uninstalled, a testimony to how poorly written the apps are! To fully ensure you have uninstalled it please download the free version of FindAnyFile directly from the developer. Then have it search your system for the following:
Have it Trash any files with those names in them and then ensure the Trash is empty.
Then restart in Safe Mode, with all wired peripherals (External Hard Disks, Printers, Scanners, etc..) disconnected and however with the keyboards charging cable plugged in so the keyboard appears as a wired keyboard. Then restart normally and test.
If the behavior. you are complaining about it still that that indicates that Avira & CCleaner has damaged Mac OS and you will need to install Mac OS in the Recovery Partition. However, before going to those lengths, please let us know so we can instruct you.