Send to printer and get barcode

Hello! Im totally new in this platform, so please sorry if my question is dumb.

  1. I have a computer connected to a barcode scanner through USB. Would it be possible that when I read a barcode the game searches the input for a specific content I have to display on the screen?

  2. Can I send some text to be printed directly to a printer connected with USB without asking to print before? My idea is that in this game users can touch a button PRINT and this will print directly some content. Is this possible?

Thank you!