BlackBerry Ltd on Wednesday filed a patent infringement lawsuit accusing Twitter Inc of illegally using technology in its mobile messaging applications that had been developed by the former smartphone maker.