I recently started using LuaMacros to create a poor Stream Deck

However, I'm having a problem that I can't get around.
I have a script, calm, when I open a notepad for example and run my maps in the notepad, the result comes out in OBS STUDIO normally and in the notepad no key is typed. In any application with a browser, pages, text fields, etc ... if I press 'C' the 'C' map is executed and everything goes well.
However, when I join a game, things change and when pressing 'C' in addition to executing the programmed map (successfully) it also performs an action in the game related to that 'C' key.
For example, if I have an action on pressing 'R' that will do something in OB STUDIO, then pressing the 'R' on the notepad, browser and etc ... this action occurs in OBS and no 'R' appears in the text fields, or in the notepad. But, when doing the same thing within the game, pressing the letter 'R' in addition to executing the OBS map he also reloads the player's weapon.
How could I prevent the game from identifying the keys typed on the second keyboard?
as I said, in any other application it works perfectly, but not in games.
Thanks!