How to detect key pressed like E in a plugin

I’m trying to figure out how to detect when a developer pressed a key on their keyboard with my plugin:

The Plugin

Productivity plugin: tracks developer activity throughout different times of the day for a long term. (1 week or month). With this data, developer schedules can be optomized by detecting:

  1. Areas of fatique/burnout. Developers can readjust their schedules to detect common areas of burnout and make adjustments.
  2. Natural dips and productivity. Each person has biological differences in productivity at different parts of the day. Detecting patterns of activity can help reveal these natural patterns.

How I Tried Doing This

Im currently trying to use Game:GetService(“UsersinputService”) however it does not work in areas such as scripts and only when the mouse is interacting with the 3D environment.

Call to Action

What is a way I can determine user inputs in other areas such as when they type in scripts to detect activity so the plugin can measure and gather dev insights?

1 Like

idk because for me user input service worked, you can use 100% local scripts in your modules because they are on your computer, eventually server ones for data stores from what i know but idk if it applies to modules too

you can use ScriptEditorService to detect when a change is made within a script


local ScriptEditorService = game:GetService("ScriptEditorService")

ScriptEditorService.TextDocumentDidChange:Connect(function(document, changes)
	local typedWord = changes[1]["text"] -- the typed word
	print(typedWord) -- a test
end)

idk how to detect when a player clicks something while not interacting with the 3d world though

Clicking can be detected outside of the 3D word using pluginmouse. Do you know if i could detect mouse movement outside of the 3D space?