Locking focus on a component during mouse movement (which can then move to other components during the movement) isn't a positive experience, I think, and it can lead to annoying side effects: the user is actually acting on a control they didn't expect because it changed without their knowledge.
Then, obviously, your changes will only work if the component is instantiated at runtime; otherwise, you should build a new component and install it in the Lazarus IDE.