Can i use pygame for keyboard input detection?

Ok i have no clue where to start with panda3d when it comes to keyboard input. So i was wondering if it would be ok to use pygame library along with panda3d?

I don’t know about the pygame libraries, but in panda3d, this can do keyboard input:

from direct.directbase.DirectStart import *
from direct.showbase.DirectObject import *
import sys

class World(DirectObject):
    def __init__(self):
        self.accept("escape",sys.exit)

w = World()
run()

Press escape and the program will call sys.exit()
Find out more at the manual.

Some people use PyGame with Panda, although Panda supports input devices just as well.