We here consider a generalization of the Klein-Gordon scalar wave equation which involves a single arbitrary function. The quantization may be viewed as allowing $\hbar$ to be a function of the momentum or wave vector rather than a constant. The generalized theory is most easily viewed in the wave vector space analog of the Lagrangian. We need no reference to spacetime. In the generalized theory the de Broglie relation between wave vector and momentum is generalized, as are the canonical commutation relations and the uncertainty principle. The generalized uncertainty principle obtained is the same as has been derived from string theory, or by a general consideration of gravitational effects during the quantum measurement process. The propagator of the scalar field is also generalized, and an illustrative example is given in which it factors into the usual propagator times a "propagator form factor."