This appeal has been brought in an untimely manner. The district court held that Joshua Patton had an attorney for the purpose of filing an appeal and that attorney failed to perfect and complete an appeal. The court then granted the out-of-time appeal *167while giving no weight to the written waiver of appeal signed by Patton in his plea agreement. Because Patton has signed this waiver of appeal, and his plea agreement has not been set aside, we hold that we do not have jurisdiction. Accordingly, we dismiss the case.
Background Facts
In 2003, Patton pled guilty to one count of attempted manufacture of methamphetamine, a severity level 1 drug felony, and one count of possession of anhydrous ammonia in an unapproved container, a severity level 4 drug felony. During the entire preceding, Patton was represented by counsel.
Patton made a plea agreement with the State. See K.S.A. 2005 Supp. 22-3210. Patton agreed to plead guilty to the attempted manufacture charge and the anhydrous ammonia charge. Furthermore, he agreed to waive his right to appeal and not file any motions under K.S.A. 60-1507. In exchange, the State agreed to dismiss all of the remaining charges and recommend a downward durational departure sentence of 78 months’ imprisonment.
At sentencing, Patton’s criminal history score was determined to be I, resulting in a possible 146-month prison sentence. After reviewing Patton’s motion for downward durational departure and motion for dispositional departure, and being aware that Patton tested positive for methamphetamine ingestion, the sentencing court granted only the durational departure motion. Patton received a 78-month sentence for the methamphetamine charge and an 11-month concurrent sentence for the anhydrous ammonia charge.
We note that the sentencing court informed Patton of his right to appeal, “specifically, in regards to the finding against him on the dispositional departure.” Patton, however, did not file an appeal within the statutory time.
In March 2004, Patton filed a motion to correct an illegal sentence under K.S.A. 22-3504, claiming that he should have been sentenced with a severity level 3 drug felony under K.S.A. 65-4161 (a) instead of K.S.A. 65-4159, a severity level 1 drug felony. In his motion to correct an illegal sentence, Patton did not comment on the absence of his direct appeal but did request the court to apply *168the ruling of State v. McAdam, 277 Kan 136, 83 P.3d 161 (2004), to his sentence.
In due course, the district court denied his motion, finding that McAdam did not apply retroactively to his sentence because Patton failed to raise the issue on direct appeal. A panel of this court affirmed that ruling, holding that McAdam only affects direct appeals from sentencing and, thus, could not apply retroactively to Patton’s collateral attack. See State v. Patton, No. 92,682, unpublished opinion filed May 13, 2005.
Then, in June 2005, Patton filed a motion under K.S.A. 60-1507, requesting the district court to allow him to file his direct appeal out of time. He alleged his attorney failed to perfect and complete his appeal. Patton stated at the hearing that he thought he was originally going to be released on probation and when he was not, he then wanted to appeal. He failed to make contact with his lawyer within the statutory time and then asked his mother to discuss the matter with his lawyer. After conducting a hearing on the matter, the district court determined that the evidence supported Patton’s claim under the third exception of State v. Ortiz, 230 Kan. 733, Syl. ¶ 3, 640 P.2d 1255 (1982). The district court then granted Patton’s motion and ordered him to file this appeal within 10 days. This matter is now brought to us.
The two issues that Patton raises in this appeal are: (1) he should have received a severity level 3 drug sentence and (2) he should have been placed on probation.
The State asserts throughout its arguments in this case that Patton waived his right to appeal in the plea agreement and therefore the district court’s finding that the third exception to Ortiz was applicable was incorrect. The State therefore claims that this court should dismiss the appeal as untimely. This is a question of law regarding this court’s jurisdiction to hear this appeal.
Jurisdiction
“Whether a court has jurisdiction over a matter is a question of law over which an appellate court has unlimited review.” State v. Campbell, 273 Kan. 414, Syl. ¶ 1, 44 P.3d 349 (2002). In addition, the right to appeal is entirely statutoiy and is not contained in the *169United States or Kansas Constitutions. State v. Legero, 278 Kan. 109, Syl. ¶ 2, 91 P.3d 1216 (2004). Therefore, “[a] knowing and voluntary waiver by the defendant of his statutory right to appeal is generally enforceable.” Campbell, 273 Kan. at 425.
It is well established that an appellate court has no jurisdiction to entertain an appeal by the defendant in a criminal case unless the defendant appeals within the time prescribed by the statutes providing for such an appeal. State v. Flynn, 274 Kan. 473, 477, 55 P.3d 324 (2002). Three limited exceptions have been recognized by our Supreme Court:
“A limited exception to the general rule requiring a timely appeal from sentencing is recognized in the interest of fundamental fairness only in those cases where an indigent defendant was either: (1) not informed of [any] rights to appeal; (2) was not furnished an attorney to perfect an appeal; or (3) was furnished an attorney for that purpose who failed to perfect and complete an appeal.” (Emphasis added.) State v. Phinney, 280 Kan. 394, 401, 122 P.3d 356 (2005) (citing Ortiz, 230 Kan. at 735-36).
In this case, paragraph 6 of the plea agreement contains Patton’s waiver of his appeal rights. It states: “The defendant waives his right of appeal, and waives his right to file any motions under K.S.A. 60-1507 arising from this matter.”
On March 20, 2003, Patton signed the plea agreement and attended the plea hearing. At that hearing, Patton orally confirmed that he (1) had read and fully understood the plea agreement; (2) had authorized it to be drafted; and (3) had agreed with the statement and the conditions in the document. In spite of this, Patton filed a motion under K.S.A. 60-1507, over 2 years later, claiming that he should be allowed to file his appeal out-of-time because his trial counsel was ineffective in failing to perfect his appeal within 10 days following imposition of sentence. See K.S.A. 22-3608(c).
It is quite clear that at the Ortiz hearing, the facts were not contested. Patton expressed his desire to appeal; he had attempted to contact his attorney through his mother; his attorney failed to contact Patton since the sentencing; his attorney faxed the proper appellate documents to Patton’s mother; and no appeal was filed.
The district court also questioned the waiver:
*170“THE COURT: So the motion for dispositional departure was not part and parcel of the plea agreement, was it?
“[State]: No.
“THE COURT: And as such, his agreement to waive his right to appeal would not affect that, would it, since it was not part of the plea agreement?
“[State]: I — that could be an interpretation.
“THE COURT: So what would be the basis of the State of Kansas moving to set aside the plea if — if he was to exercise his rights?
“[State]: Well, the State’s position could be that, by taking an appeal, he is violating the agreement, just on its face.
“[State]: . . . but there’s also that flip side of, hey, you said you wouldn’t appeal —
“ — and there was no limitation on what he would not appeal from.
It’s a straight — it’s a flat, I will not appeal.”
Ultimately the district court held that the third exception under Ortiz applied and granted Patton’s appeal out of time. When asked for clarification from the State’s attorney, the court said:
“The last information that was received was that this appeal should be filed. Maybe it could be that Mr. Patton would have dismissed his appeal after reviewing this matter, but I don’t lcnow that. The last indication was, is that the appeal was to be filed. Therefore, in the interest of justice and in the interest — and pursuant to case law, this Court finds that, although he had an attorney, that the appeal was not perfected, and he should gain access to the courts.
“You lcnow, we can go all the way through the rights of due process, but if — if the defendant ■ — • and the Court notes and the Court looks at the plea agreement and notes in the plea agreement it states the defendant waives his right to appeal, and that’s the plea agreement. Not contained in that plea agreement is the motion of dispositional departure, and the parties state that they are free to argue that at sentencing. If the plea agreement was to concern the motion of dispositional departure, I believe it would have said something to the point that the notice of appeal, as — as to all issues involved at sentencing, et cetera. It’s not. The plea agreement is veiy explicit that the motion for dispositional departure may be argued by the parties. Parties don’t know what the Court’s ruling is going to be at that time. They don’t lcnow what my findings are going to be.
“[a]fter considering all these matters, [the Court] finds the defendant should be allowed to file his appeal out of time.” (Emphasis added.)
In its order, the district court only addressed the Ortiz issue, not the written waiver. By doing this, the court did not limit Patton’s *171appeal only to the dispositional departure motion. But, we cannot ignore the presence of Patton’s written waiver of his right to appeal.
While it is clear that the evidence supports the third exception under Ortiz, it is not clear that the district court had the power to apply that ruling because Patton had previously waived his right to appeal in his plea agreement. The court evidently decided that if the dispositional departure motion was not covered by the plea agreement then the waiver was ineffective. We can only assume this is the court’s position since it did not say one way or the other. Even if we construe the written waiver of appeal not to include the dispositional departure motion, we lack jurisdiction to hear the matter. Simply put, it has been held that when a district court imposes presumptive sentences, an appellate court lacks jurisdiction to consider claims that the trial court erred in denying a motion seeking a departure sentence. State v. Flores, 268 Kan. 657, 660, 999 P.2d 919 (2000).
If the only subject of this appeal could be whether Patton should be placed on probation, that is not the effect of the district court’s ruling because Patton also raises the McAdam sentencing issue, which was clearly covered by the written waiver of appeal in the plea agreement.
A series of three cases helps us decide this issue, Ortiz, 230 Kan. 733, State v. Willingham, 266 Kan. 98, 967 P.2d 1079 (1998), and Campbell, 273 Kan. 414, Syl. ¶ 1. All three lead us to the conclusion that written waivers of appeal rights must be given weight. They are contracts between the parties not to be ignored the courts.
First, we turn to Ortiz itself for guidance on the interplay between written appeal waivers and the exceptions that permit untimely appeals. In Ortiz, the defendant signed a written waiver and its provisions were specific:
“I want to state my intentions with regard to any appeals concerning the two cases that have been previously named in this letter. . . .
“Regarding case No. 78-CR-37, ... I NOW STATE THAT I DO NOT WANT TO APPEAL THE SENTENCE OF THE COURT ....
“Furthermore, in case No. 79-CR-15 I also state that I do not want to appeal that case and in fact, have been so informed by the Court that upon my plea of guilty to said charge that I forego any further appeal rights on account thereof.
*172“EVEN THOUGH I KNOW THAT I HAVE AN ABSOLUTE RIGHT TO APPEAL THE SENTENCE HANDED DOWN IN CASE NO. 78-CR-37,1 DO NOT WANT TO DO SO AND I SEPARATELY IN THIS SENTENCE EMPHASIZE THIS MATTER.” 230 Kan. at 733-34.
Over a year later, Ortiz filed a K.S.A. 60-1507 motion where he claimed he was illiterate and had failed to understand his appeal rights when he signed the written waiver. When making its final ruling on the subject, our Supreme Court held the written waiver disproved the allegations in his K.S.A. 60-1507 motion. Furthermore, it noted he had the assistance of an interpreter to assure his understanding. As a consequence, his appeal was dismissed for want of jurisdiction. 230 Kan. at 736-37. Clearly, written waivers have an effect on a defendant’s attempt to file an untimely appeal.
We point out that the facts in this case are not identical with Ortiz. Here, the written waiver was not as explicit as the waiver in Ortiz. Further, Patton never claimed that he did not knowingly or intelligently waive his right to appeal as was tire case in Ortiz. Patton claimed that he asserted his right and that his attorney failed to file the appeal. Finally, the evidence was clear in this case that Patton wanted to appeal and his attorney failed to take the proper steps.
Moving forward we turn next to Willingham, 266 Kan. at 100-02, for guidance regarding what weight written waivers should be given in Ortiz-type situations. In Willingham, the court held that despite the defendant’s apparent verbal desire not to appeal, the record on appeal was insufficient to demonstrate that the defendant waived his right to appeal. But the court noted that it may have held differently had the trial counsel followed the provisions of K.A.R. 105-3-9. 266 Kan. at 101. The regulation, K.A.R. 105-3-9, deals with court-appointed trial counsel and what is expected of them after sentencing. It provides:
“(a) In order to protect a convicted defendant’s right to appeal, it shall be the duty of each trial counsel to prepare, file, or both, the following documents:
“(3) file a notice of appeal in a timely manner, unless a waiver of the right to appeal has been signed by the defendant.” (Emphasis added.) K.A.R. 105-3-9(a)(3).
*173From this it is clear that Willingham reasoned that the basis of an Ortiz denial of a defendant’s appeal would be grounded in the fact that the defendant had made a written waiver of the right to appeal. 266 Kan. at 101. Because Patton waived his right to appeal in writing, under K.A.R. 105-3-9(a)(3) this conduct also removed his appointed counsel’s duty to file an appeal for him within the 10 days following sentencing.
We conclude that in the absence of a withdrawal of his plea agreement, Patton’s written waiver of his right to appeal stands as a bar to permitting this appeal.
We believe this holding is in accordance with Campbell, 273 Kan. 414, another case which involved a written waiver in a sentencing agreement. In Campbell, the defendant signed a written sentencing agreement, stating that the defendant “ waives any right to appeal the verdict against him. . . .’” 273 Kan. at 419. At his sentencing hearing, Campbell confirmed that he understood the agreement. But at the sentencing, the district court failed to inform the defendant of his right to appeal.
On appeal, the defendant failed to address the waiver issue. Campbell also noted that the defendant never alleged that the waiver of the right to appeal his convictions was not entered into freely and knowingly. As a result, the court held that despite the sentencing court’s failure to fulfill its statutory duty, this failure did not overcome the defendant’s waiver. 273 Kan. at 425. The Campbell court looked at the bargain and stated:
“Campbell bargained with the State for a reduction in sentence in exchange for his cooperation, testimony against [a codefendant], and waiver of his appeal rights. The State abided by the terms of the agreement. Thus, Campbell knowingly and voluntarily waived the right to appeal his conviction when he entered into the sentencing agreement with the State.” 273 Kan. at 425.
The facts are similar here. First, Patton’s brief fails to mention tire waiver issue. Second, the record shows that Patton entered into the plea agreement freely and knowingly. Third, Patton bargained with the State for a downward durational departure of his sentence and for the dismissal of four other charges in exchange for his cooperation, such as giving testimony against Benjamin Faulkner, stipulating to the admission of a report and its results and the *174waiver of his right to appeal. Fourth, Patton concedes that the State complied with the plea agreement terms. Therefore, similar to the holding in Campbell, despite the trial counsel’s alleged failure to file his notice of appeal within the statutory time period, this alleged failure should not replace the fact that Patton knowingly and voluntarily waived his right to appeal.
In this case, where the defendant bargained with tire State and knowingly and voluntarily agreed to waive his right to appeal in exchange for a sentence reduction and dismissal of additional charges, the district court cannot ignore the waiver because it stands as a bar to the defendant filing an appeal unless the plea agreement is set aside.
Appeal dismissed.